]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #38770 from votdev/wip-48629-octopus
authorYuri Weinstein <yweinste@redhat.com>
Mon, 11 Jan 2021 20:00:24 +0000 (12:00 -0800)
committerGitHub <noreply@github.com>
Mon, 11 Jan 2021 20:00:24 +0000 (12:00 -0800)
octopus: mgr/dashboard: The /rgw/status endpoint does not check for running service

Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Alfonso Martínez <almartin@redhat.com>
Reviewed-by: Nizamudeen A <nia@redhat.com>
1  2 
src/pybind/mgr/dashboard/controllers/rgw.py

index 6e17f3e80278abc6ac216caa2dfb8eaf8bba8592,55a6fbcddb7d3d038ea01dad4fbfad8e61d7aad5..f3a885a21ac397ec09c92005ca29e0dec780b8a1
@@@ -30,21 -30,11 +30,23 @@@ class Rgw(BaseController)
      def status(self):
          status = {'available': False, 'message': None}
          try:
+             if not CephService.get_service_list('rgw'):
+                 raise LookupError('No RGW service is running.')
              instance = RgwClient.admin_instance()
              # Check if the service is online.
 -            if not instance.is_service_online():  # pragma: no cover - no complexity there
 +            try:
 +                is_online = instance.is_service_online()  # pragma: no cover - no complexity there
 +            except RequestException as e:
 +                # Drop this instance because the RGW client seems not to
 +                # exist anymore (maybe removed via orchestrator). Removing
 +                # the instance from the cache will result in the correct
 +                # error message next time when the backend tries to
 +                # establish a new connection (-> 'No RGW found' instead
 +                # of 'RGW REST API failed request ...').
 +                # Note, this only applies to auto-detected RGW clients.
 +                RgwClient.drop_instance(instance.userid)
 +                raise e
 +            if not is_online:
                  msg = 'Failed to connect to the Object Gateway\'s Admin Ops API.'
                  raise RequestException(msg)
              # Ensure the API user ID is known by the RGW.