Merge "Change SR-IOV agent to log message after failure"

This commit is contained in:
Zuul 2019-02-12 19:53:33 +00:00 committed by Gerrit Code Review
commit 3aac42b3c7
1 changed files with 6 additions and 0 deletions

View File

@ -159,6 +159,7 @@ class SriovNicSwitchAgent(object):
LOG.info("RPC agent_id: %s", self.agent_id)
self.topic = topics.AGENT
self.failed_report_state = False
self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS)
# RPC network init
# Handle updates from service
@ -188,7 +189,12 @@ class SriovNicSwitchAgent(object):
self.agent_state.pop('resource_versions', None)
self.agent_state.pop('start_flag', None)
except Exception:
self.failed_report_state = True
LOG.exception("Failed reporting state!")
return
if self.failed_report_state:
self.failed_report_state = False
LOG.info("Successfully reported state after a previous failure.")
def _create_agent_extension_manager(self, connection):
ext_manager.register_opts(self.conf)