From 6287c90d49bc8d68d935abaa28255e0bb59ddc01 Mon Sep 17 00:00:00 2001 From: Daniel Badea Date: Wed, 23 Jan 2019 15:12:17 +0000 Subject: [PATCH] fail to apply manifests when management ip is missing Commit to fix bug #1790159 causes retry handler to fail because of mismatched function arguments. Remove 'self' from retry handler and fix error message formatting. Change-Id: Iedeb41451acd0f32b944b49d45f0c4b30a79ebc2 Closes-Bug: #1805678 --- sysinv/sysinv/sysinv/sysinv/agent/manager.py | 5 +++-- sysinv/sysinv/sysinv/sysinv/common/exception.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sysinv/sysinv/sysinv/sysinv/agent/manager.py b/sysinv/sysinv/sysinv/sysinv/agent/manager.py index c562ad76cc..c2677aafcf 100644 --- a/sysinv/sysinv/sysinv/sysinv/agent/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/agent/manager.py @@ -1380,8 +1380,9 @@ class AgentManager(service.PeriodicService): self._update_config_applied(iconfig_uuid) self._report_config_applied(context) - def _retry_on_missing_mgmt_ip(self, exception): - return isinstance(exception, exception.LocalManagementIpNotFound) + def _retry_on_missing_mgmt_ip(ex): + LOG.info('Caught exception. Retrying... Exception: {}'.format(ex)) + return isinstance(ex, exception.LocalManagementIpNotFound) @retrying.retry(wait_fixed=15 * 1000, stop_max_delay=300 * 1000, retry_on_exception=_retry_on_missing_mgmt_ip) diff --git a/sysinv/sysinv/sysinv/sysinv/common/exception.py b/sysinv/sysinv/sysinv/sysinv/common/exception.py index 8bb17e0c27..034f3b3e88 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/exception.py +++ b/sysinv/sysinv/sysinv/sysinv/common/exception.py @@ -1287,8 +1287,8 @@ class InvalidHelmNamespace(Invalid): class LocalManagementIpNotFound(NotFound): message = _("Local management IP not found: " - "config_uuid=%(config_uuid), config_dict=%(config_dict), " - "host_personality=%(host_personality)") + "config_uuid=%(config_uuid)s, config_dict=%(config_dict)s, " + "host_personality=%(host_personality)s") class InvalidHelmDockerImageSource(Invalid):