Merge "retry func iconfig_update_file when host personality is None"
This commit is contained in:
commit
5442d321d1
|
@ -1291,6 +1291,12 @@ class AgentManager(service.PeriodicService):
|
||||||
fileinput.close()
|
fileinput.close()
|
||||||
os.rename(temp_platform_conf_file, tsc.PLATFORM_CONF_FILE)
|
os.rename(temp_platform_conf_file, tsc.PLATFORM_CONF_FILE)
|
||||||
|
|
||||||
|
def _retry_on_personality_is_none(ex):
|
||||||
|
LOG.info('Caught exception. Retrying... Exception: {}'.format(ex))
|
||||||
|
return isinstance(ex, exception.LocalManagementPersonalityNotFound)
|
||||||
|
|
||||||
|
@retrying.retry(wait_fixed=10 * 1000, stop_max_delay=300 * 1000,
|
||||||
|
retry_on_exception=_retry_on_personality_is_none)
|
||||||
@utils.synchronized(LOCK_AGENT_ACTION, external=False)
|
@utils.synchronized(LOCK_AGENT_ACTION, external=False)
|
||||||
def iconfig_update_file(self, context, iconfig_uuid, iconfig_dict):
|
def iconfig_update_file(self, context, iconfig_uuid, iconfig_dict):
|
||||||
"""Configure the iiconfig_uuid, by updating file based upon
|
"""Configure the iiconfig_uuid, by updating file based upon
|
||||||
|
@ -1314,6 +1320,11 @@ class AgentManager(service.PeriodicService):
|
||||||
if not permissions:
|
if not permissions:
|
||||||
permissions = constants.CONFIG_FILE_PERMISSION_DEFAULT
|
permissions = constants.CONFIG_FILE_PERMISSION_DEFAULT
|
||||||
|
|
||||||
|
if not self._ihost_personality:
|
||||||
|
raise exception.LocalManagementPersonalityNotFound(
|
||||||
|
config_uuid=iconfig_uuid, config_dict=iconfig_dict,
|
||||||
|
host_personality=self._ihost_personality)
|
||||||
|
|
||||||
if self._ihost_personality in iconfig_dict['personalities']:
|
if self._ihost_personality in iconfig_dict['personalities']:
|
||||||
file_content = iconfig_dict['file_content']
|
file_content = iconfig_dict['file_content']
|
||||||
|
|
||||||
|
|
|
@ -1298,6 +1298,12 @@ class InvalidHelmNamespace(Invalid):
|
||||||
message = _("Invalid helm overrides namespace (%(namespace)s) for chart %(chart)s.")
|
message = _("Invalid helm overrides namespace (%(namespace)s) for chart %(chart)s.")
|
||||||
|
|
||||||
|
|
||||||
|
class LocalManagementPersonalityNotFound(NotFound):
|
||||||
|
message = _("Local management personality is None: "
|
||||||
|
"config_uuid=%(config_uuid)s, config_dict=%(config_dict)s, "
|
||||||
|
"host_personality=%(host_personality)s")
|
||||||
|
|
||||||
|
|
||||||
class LocalManagementIpNotFound(NotFound):
|
class LocalManagementIpNotFound(NotFound):
|
||||||
message = _("Local management IP not found: "
|
message = _("Local management IP not found: "
|
||||||
"config_uuid=%(config_uuid)s, config_dict=%(config_dict)s, "
|
"config_uuid=%(config_uuid)s, config_dict=%(config_dict)s, "
|
||||||
|
|
Loading…
Reference in New Issue