summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-06-06 14:58:24 +0000
committerGerrit Code Review <review@openstack.org>2017-06-06 14:58:24 +0000
commit5e383dbac6c5ecdf624e314410713fbfe41a7a76 (patch)
treeb564e1aa7ab9273390e7bf9bc05752145e3b1a4f
parent29de9b8ff7b215ee07d34d2a58c806a9d896d227 (diff)
parentc3aa06d954e32ba73ed26ca0c8496311fc6d5ebb (diff)
Merge "Add port to database with supported device_owner" into stable/newton
-rw-r--r--networking_arista/ml2/mechanism_arista.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/networking_arista/ml2/mechanism_arista.py b/networking_arista/ml2/mechanism_arista.py
index 5be6e84..5975501 100644
--- a/networking_arista/ml2/mechanism_arista.py
+++ b/networking_arista/ml2/mechanism_arista.py
@@ -401,6 +401,18 @@ class AristaDriver(driver_api.MechanismDriver):
401 401
402 return 402 return
403 403
404 def _supported_device_owner(self, device_owner):
405 supported_device_owner = [n_const.DEVICE_OWNER_DHCP,
406 n_const.DEVICE_OWNER_DVR_INTERFACE]
407
408 if any([device_owner in supported_device_owner,
409 device_owner.startswith('compute') and
410 device_owner != 'compute:probe',
411 device_owner.startswith('baremetal')]):
412 return True
413
414 LOG.info(_LI('Unsupported device owner: %s'), device_owner)
415
404 def _network_owner_tenant(self, context, network_id, tenant_id): 416 def _network_owner_tenant(self, context, network_id, tenant_id):
405 tid = tenant_id 417 tid = tenant_id
406 if network_id and tenant_id: 418 if network_id and tenant_id:
@@ -544,7 +556,7 @@ class AristaDriver(driver_api.MechanismDriver):
544 pretty_log("update_port_precommit: new", new_port) 556 pretty_log("update_port_precommit: new", new_port)
545 pretty_log("update_port_precommit: orig", orig_port) 557 pretty_log("update_port_precommit: orig", orig_port)
546 558
547 if new_port['device_owner'] == 'compute:probe': 559 if not self._supported_device_owner(new_port['device_owner']):
548 return 560 return
549 561
550 # Check if it is port migration case 562 # Check if it is port migration case
@@ -643,6 +655,9 @@ class AristaDriver(driver_api.MechanismDriver):
643 host = context.host 655 host = context.host
644 is_vm_boot = device_id and device_owner 656 is_vm_boot = device_id and device_owner
645 657
658 if not self._supported_device_owner(device_owner):
659 return
660
646 vnic_type = port['binding:vnic_type'] 661 vnic_type = port['binding:vnic_type']
647 binding_profile = port['binding:profile'] 662 binding_profile = port['binding:profile']
648 bindings = [] 663 bindings = []
@@ -804,6 +819,10 @@ class AristaDriver(driver_api.MechanismDriver):
804 port_id = port['id'] 819 port_id = port['id']
805 network_id = port['network_id'] 820 network_id = port['network_id']
806 device_owner = port['device_owner'] 821 device_owner = port['device_owner']
822
823 if not self._supported_device_owner(device_owner):
824 return
825
807 vnic_type = port['binding:vnic_type'] 826 vnic_type = port['binding:vnic_type']
808 binding_profile = port['binding:profile'] 827 binding_profile = port['binding:profile']
809 switch_bindings = [] 828 switch_bindings = []