Merge "notification: Add 'status' to agent after_create/update"

This commit is contained in:
Zuul 2018-11-05 21:25:10 +00:00 committed by Gerrit Code Review
commit 2a7079ddd1
3 changed files with 15 additions and 2 deletions

View File

@ -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):

View File

@ -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

View File

@ -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.