← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~smoser/cloud-init:bug/1642679-more-openstack-nic-types into cloud-init:master

 

Scott Moser has proposed merging ~smoser/cloud-init:bug/1642679-more-openstack-nic-types into cloud-init:master.

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1642679 in cloud-init: "The OpenStack network_config.json implementation fails on Hyper-V compute nodes"
  https://bugs.launchpad.net/cloud-init/+bug/1642679

For more details, see:
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/311548
-- 
Your team cloud init development team is requested to review the proposed merge of ~smoser/cloud-init:bug/1642679-more-openstack-nic-types into cloud-init:master.
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 61b0b08..42db5c2 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -61,6 +61,19 @@ OS_VERSIONS = (
     OS_LIBERTY,
 )
 
+PHYSICAL_TYPES = (
+    None,
+    'bridge',
+    'ethernet',
+    'hw_veb',
+    'hyperv',
+    'ovs',
+    'phy',
+    'tap',
+    'vhostuser',
+    'vif',
+)
+
 
 class NonReadable(IOError):
     pass
@@ -583,8 +596,7 @@ def convert_net_json(network_json=None, known_macs=None):
                 subnet['ipv6'] = True
             subnets.append(subnet)
         cfg.update({'subnets': subnets})
-        if link['type'] in [None, 'ethernet', 'vif', 'ovs', 'phy',
-                            'bridge', 'tap']:
+        if link['type'] in PHYSICAL_TYPES:
             cfg.update({'type': 'physical', 'mac_address': link_mac_addr})
         elif link['type'] in ['bond']:
             params = {}