[openstack-dev] [Neutron] _notify_port_updated in ML2 plugin doesn't take effect under some conditions

2014-03-17 Thread Li Ma
Hi stackers,

I'm trying to extend the capability of port by propagating
binding:profile from neutron-server to l2-agents.

When I issue update-port-api with a new binding:profile, I find that the
action is not notified to any agents. Then I check the code and find the
following function:

def _notify_port_updated(self, mech_context):
port = mech_context._port
segment = mech_context.bound_segment
if not segment:
# REVISIT(rkukura): This should notify agent to unplug port
network = mech_context.network.current
LOG.warning(_(In _notify_port_updated(), no bound segment for 
  port %(port_id)s on network %(network_id)s),
{'port_id': port['id'],
 'network_id': network['id']})
return
self.notifier.port_update(mech_context._plugin_context, port,
  segment[api.NETWORK_TYPE],
  segment[api.SEGMENTATION_ID],
  segment[api.PHYSICAL_NETWORK])

I'm not sure why it checks bound segment here to prevent sending
port_update out?
In my situation, I run a devstack environment and the bound segment is
None by default. Actually, I need this message to be sent out in any
situations.

I'd appreciate any hints.

Thanks a lot,

-- 
---
cheers,
Li Ma


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Neutron] _notify_port_updated in ML2 plugin doesn't take effect under some conditions

2014-03-17 Thread Li Ma
Misunderstanding. Just find out this message is sent to
notifications.info topic.

Anyway, is there any solution to get port_update_info from l2-agents?

Thanks,
Li Ma

On 3/17/2014 4:11 PM, Li Ma wrote:
 Hi stackers,

 I'm trying to extend the capability of port by propagating
 binding:profile from neutron-server to l2-agents.

 When I issue update-port-api with a new binding:profile, I find that the
 action is not notified to any agents. Then I check the code and find the
 following function:

 def _notify_port_updated(self, mech_context):
 port = mech_context._port
 segment = mech_context.bound_segment
 if not segment:
 # REVISIT(rkukura): This should notify agent to unplug port
 network = mech_context.network.current
 LOG.warning(_(In _notify_port_updated(), no bound segment for 
   port %(port_id)s on network %(network_id)s),
 {'port_id': port['id'],
  'network_id': network['id']})
 return
 self.notifier.port_update(mech_context._plugin_context, port,
   segment[api.NETWORK_TYPE],
   segment[api.SEGMENTATION_ID],
   segment[api.PHYSICAL_NETWORK])

 I'm not sure why it checks bound segment here to prevent sending
 port_update out?
 In my situation, I run a devstack environment and the bound segment is
 None by default. Actually, I need this message to be sent out in any
 situations.

 I'd appreciate any hints.

 Thanks a lot,


-- 

cheers,
Li Ma


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Neutron] _notify_port_updated in ML2 plugin doesn't take effect under some conditions

2014-03-17 Thread Li Ma
Updated. I commented out the segment checking in _notify_port_updated of
ml2-plugin, and finally I can get port_update message on l2-agents.

Is there any side effect? It is working for me, but I'm not sure it is
the real solution.

thanks,

-- 

cheers,
Li Ma


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev