Skip to content

Commit

Permalink
Be more permissive for Ceph RGW services to be empty in migrate_rgws
Browse files Browse the repository at this point in the history
* Be more permissive for Ceph RGW services to be empty in `migrate_rgws`
* Ensure we are validating current Ceph status data for migration
* Adapt to changes of PR #101

Fixes: #98
Signed-off-by: Tobias Wolf <[email protected]>
  • Loading branch information
NotTheEvilOne authored Nov 13, 2024
1 parent 628159f commit a075397
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rookify/modules/migrate_rgws/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def _get_rgw_daemon_hosts(self) -> List[str]:
state_data = self.machine.get_preflight_state("AnalyzeCephHandler").data

return self._get_rgw_daemon_hosts_of_map(
state_data["report"]["servicemap"]["services"]["rgw"]["daemons"]
state_data["report"]["servicemap"]["services"]
.get("rgw", {})
.get("daemons", {})
)

def _get_rgw_daemon_hosts_of_map(
Expand Down Expand Up @@ -101,7 +103,9 @@ def _migrate_rgw(self, rgw_host: str) -> None:
ceph_status = self.ceph.mon_command("status")

rgw_daemon_hosts = self._get_rgw_daemon_hosts_of_map(
ceph_status["servicemap"]["services"]["rgw"]["daemons"]
ceph_status["servicemap"]["services"]
.get("rgw", {})
.get("daemons", {})
)

if rgw_host not in rgw_daemon_hosts:
Expand Down Expand Up @@ -140,7 +144,9 @@ def _migrate_rgw(self, rgw_host: str) -> None:
ceph_status = self.ceph.mon_command("status")

rgw_daemon_hosts = self._get_rgw_daemon_hosts_of_map(
ceph_status["servicemap"]["services"]["rgw"]["daemons"]
ceph_status["servicemap"]["services"]
.get("rgw", {})
.get("daemons", {})
)

if rgw_host in rgw_daemon_hosts:
Expand Down

0 comments on commit a075397

Please sign in to comment.