]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Merge "ML2 Cisco Nexus MD: VM migration support"
authorJenkins <jenkins@review.openstack.org>
Mon, 24 Mar 2014 07:36:58 +0000 (07:36 +0000)
committerGerrit Code Review <review@openstack.org>
Mon, 24 Mar 2014 07:36:58 +0000 (07:36 +0000)
1  2 
neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py
neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py

index eca142a4224a9ac03857ef2aacb0127670b3950b,d36f0d3f04f188a58c1d1a0c8855f23f2a0be402..4f624b1c068ce0066866b133827a122e09186fea
@@@ -147,13 -142,18 +142,18 @@@ class CiscoNexusMechanismDriver(api.Mec
              except excep.NexusPortBindingNotFound:
                  self.driver.delete_vlan(switch_ip, vlan_id)
  
-     def _port_action(self, context, func):
+     def _is_vm_migration(self, context):
+         if not context.bound_segment and context.original_bound_segment:
+             return (context.current.get(portbindings.HOST_ID) !=
+                     context.original.get(portbindings.HOST_ID))
+     def _port_action(self, port, segment, func):
          """Verify configuration and then process event."""
-         device_id = context.current.get('device_id')
-         host_id = context.current.get(portbindings.HOST_ID)
+         device_id = port.get('device_id')
+         host_id = port.get(portbindings.HOST_ID)
  
          # Workaround until vlan can be retrieved during delete_port_postcommit
 -        # (or prehaps unbind_port) event.
 +        # event.
          if func == self._delete_switch_entry:
              vlan_id = self._delete_port_postcommit_vlan
          else: