Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be more permissive for Ceph RGW services to be empty in migrate_rgws #103

Merged
merged 6 commits into from
Nov 13, 2024
16 changes: 13 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 @@ -137,7 +141,13 @@ def _migrate_rgw(self, rgw_host: str) -> None:
)

while True:
rgw_daemon_hosts = self._get_rgw_daemon_hosts()
ceph_status = self.ceph.mon_command("status")

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

if rgw_host in rgw_daemon_hosts:
break
Expand Down
Loading