diff --git a/neutron/db/agents_db.py b/neutron/db/agents_db.py index ad184df3d0d..309f24ec50d 100644 --- a/neutron/db/agents_db.py +++ b/neutron/db/agents_db.py @@ -425,7 +425,7 @@ class AgentDbMixin(ext_agent.AgentPluginBase, AgentAvailabilityZoneMixin): agent_state['admin_state_up'] = agent.admin_state_up registry.notify(resources.AGENT, event_type, self, context=context, host=agent_state['host'], plugin=self, - agent=agent_state) + agent=agent_state, status=status) return status, agent_state def _get_agents_considered_for_versions(self): diff --git a/neutron/services/segments/db.py b/neutron/services/segments/db.py index e05ceb7f385..4e54e8217c9 100644 --- a/neutron/services/segments/db.py +++ b/neutron/services/segments/db.py @@ -251,7 +251,8 @@ def map_segment_to_hosts(context, segment_id, hosts): def _update_segment_host_mapping_for_agent(resource, event, trigger, - context, host, plugin, agent): + context, host, plugin, agent, + status): check_segment_for_agent = getattr(plugin, 'check_segment_for_agent', None) if not check_segment_for_agent: return diff --git a/releasenotes/notes/agent-notification-signature-status-6a9b9dbce9cb9740.yaml b/releasenotes/notes/agent-notification-signature-status-6a9b9dbce9cb9740.yaml new file mode 100644 index 00000000000..29059b0694f --- /dev/null +++ b/releasenotes/notes/agent-notification-signature-status-6a9b9dbce9cb9740.yaml @@ -0,0 +1,12 @@ +--- +deprecations: + - | + The signature of notifications for resource ``agent`` for events + ``after_create`` and ``after_update`` was extended. A new keyword + argument was added: ``status``. This is to make the same status + information available to notification consumers as it was available + already where the notification is sent in class ``AgentDbMixin``. + Valid status values are defined in ``neutron_lib.agent.constants``. + Consuming notifications by the old signature is deprecated. Unless + processing arguments as ``**kwargs``, out-of-tree notification + consumers need to adapt.