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

Proposed by Scott Moser
Status: Merged
Merged at revision: 2d2ec70f06015f0624f1d0d328cc97f1fb5c29de
Proposed branch: ~smoser/cloud-init:bug/1642679-more-openstack-nic-types
Merge into: cloud-init:master
Diff against target: 34 lines (+14/-2)
1 file modified
cloudinit/sources/helpers/openstack.py (+14/-2)
Reviewer Review Type Date Requested Status
Adrian Vladu (community) Approve
Alessandro Pilotti (community) Approve
Ryan Harper Approve
Review via email: mp+311548@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) :
review: Approve
Revision history for this message
Alessandro Pilotti (alexpilotti) :
review: Approve
Revision history for this message
Adrian Vladu (avladu) :
review: Approve

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
2index 61b0b08..42db5c2 100644
3--- a/cloudinit/sources/helpers/openstack.py
4+++ b/cloudinit/sources/helpers/openstack.py
5@@ -61,6 +61,19 @@ OS_VERSIONS = (
6 OS_LIBERTY,
7 )
8
9+PHYSICAL_TYPES = (
10+ None,
11+ 'bridge',
12+ 'ethernet',
13+ 'hw_veb',
14+ 'hyperv',
15+ 'ovs',
16+ 'phy',
17+ 'tap',
18+ 'vhostuser',
19+ 'vif',
20+)
21+
22
23 class NonReadable(IOError):
24 pass
25@@ -583,8 +596,7 @@ def convert_net_json(network_json=None, known_macs=None):
26 subnet['ipv6'] = True
27 subnets.append(subnet)
28 cfg.update({'subnets': subnets})
29- if link['type'] in [None, 'ethernet', 'vif', 'ovs', 'phy',
30- 'bridge', 'tap']:
31+ if link['type'] in PHYSICAL_TYPES:
32 cfg.update({'type': 'physical', 'mac_address': link_mac_addr})
33 elif link['type'] in ['bond']:
34 params = {}

Subscribers

People subscribed via source and target branches