-
-
Save vilobhmm/2255592994b14f3b7cfd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added respective exceptions in nova/exception.py | |
nova/service.py | |
try: | |
self.servicegroup_api.start(self.host) | |
except exception.ToozBackendConnectionError: | |
msg = _("Error connecting to coordination backend") | |
raise exc.HTTPServiceUnavailable(explanation=msg) | |
except exception.ToozBackendUrlFormatNotsupported: | |
msg = _("Tooz Backend url format not supported) | |
raise exc.HTTPBadRequest(explanation=msg) | |
tz.py | |
def start(self, member_id):$ | |
backend_url = cfg.CONF.coordination.backend_url$ | |
try:$ | |
self._coordinator = tooz.coordination.get_coordinator($ | |
backend_url, member_id)$ | |
self._coordinator.start()$ | |
self._started = True$ | |
LOG.info(_LI('Coordination backend started successfully'))$ | |
except tooz.coordination.ToozError:$ | |
self._started = False$ | |
LOG.exception(_LE('Error connecting to coordination backend'))$ | |
raise exception.ToozBackendConnectionError()$ | |
except RuntimeError:$ | |
self._started = False$ | |
raise exception.ToozBackendUrlFormatNotsupported()$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment