Merge "Do not try to call status setting methods in case of periodic task"

This commit is contained in:
Zuul 2022-03-23 13:54:20 +00:00 committed by Gerrit Code Review
commit fcaebb77dc

View File

@ -118,7 +118,10 @@ class TaasAgentRpcCallback(api.TaasAgentRpcCallbackMixin):
'msg_name': 'tap_flow',
'set_status_func_name': 'set_tap_flow_status',
'fail_status': constants.PENDING_DELETE,
'succ_status': constants.INACTIVE}
'succ_status': constants.INACTIVE},
'periodic_tasks': {
'msg_name': 'periodic_tasks',
}
}
self.portbind_drivers_map = {portbindings.VNIC_DIRECT: 'sriov',
portbindings.VNIC_NORMAL: 'ovs'}
@ -132,7 +135,9 @@ class TaasAgentRpcCallback(api.TaasAgentRpcCallbackMixin):
LOG.debug("Invoking Driver for %(func_name)s from agent",
{'func_name': func_name})
status_msg = {'id': args[self.func_dict[func_name]['msg_name']]['id']}
if func_name != 'periodic_tasks':
func_dict = self.func_dict[func_name]
status_msg = {'id': args[func_dict['msg_name']]['id']}
try:
self.taas_driver.__getattribute__(func_name)(args)
@ -146,6 +151,7 @@ class TaasAgentRpcCallback(api.TaasAgentRpcCallbackMixin):
self.conf.host)
return
if func_name != 'periodic_tasks':
self.taas_plugin_rpc.__getattribute__(
self.func_dict[func_name]['set_status_func_name'])(
status_msg,