From 2d2ec70f06015f0624f1d0d328cc97f1fb5c29de Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 22 Nov 2016 16:39:13 -0500 Subject: OpenStack: extend physical types to include hyperv, hw_veb, vhost_user. This extends the list of device 'types' that are considered to be physical to include hyperv, hw_veb, and vhost_user. LP: #1642679 --- cloudinit/sources/helpers/openstack.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cloudinit/sources/helpers') diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py index 61b0b08c..42db5c27 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 = {} -- cgit v1.2.3