Merge "Retry Config agent registration with the neutron server."

This commit is contained in:
Jenkins 2017-06-26 16:40:53 +00:00 committed by Gerrit Code Review
commit 4d45c0a192
1 changed files with 7 additions and 1 deletions

View File

@ -401,7 +401,13 @@ class CiscoCfgAgentWithStateReport(CiscoCfgAgent):
for attempts in range(MAX_REGISTRATION_ATTEMPTS):
context = bc.context.get_admin_context_without_session()
self.send_agent_report(self.agent_state, context)
res = self.devmgr_rpc.register_for_duty(context)
try:
res = self.devmgr_rpc.register_for_duty(context)
except Exception:
res = False
LOG.warning(_LW("[Agent registration] Rpc exception. Neutron "
"may not be available or busy. Retrying "
"in %0.2f seconds "), REGISTRATION_RETRY_DELAY)
if res is True:
LOG.info(_LI("[Agent registration] Agent successfully "
"registered"))