Closed ubuntu-server-builder closed 1 year ago
Launchpad user Ryan McCabe(rmccabe) wrote on 2017-11-28T14:20:35.857245+00:00
ovirt will change to match openstack, so that no changes are needed.
Launchpad user Scott Moser(smoser) wrote on 2017-11-28T14:52:43.150796+00:00
Just for historic purposes, Ryan's response here was due to my comment on his merge proposal that sayd:
I'm somewhat disappointed that this passed unit tests.
There are real-ish world examples at bug 1514082 of things like: { "id": "network0", "link": "tap54d10236-5d", "network_id": "a5d1181f-bedd-40a5-8b4a-5574b74dba61", "type": "ipv4_dhcp" },
Did openstack change the 'type' value for dhcp from ipv4_dhcp or ipv6_dhcp to dhcp4 or dhcp6 ?
like you show in your bug?
This bug was originally filed in Launchpad as LP: #1734739
Launchpad details
Launchpad user Ryan McCabe(rmccabe) wrote on 2017-11-27T18:16:52.960486+00:00
It looks like there's a typo in the helpers/openstack.py network_data.json parser.
With a config like:
{ "links" : [ { "name" : "test", "id" : "test", "type" : "vif" } ], "networks" : [ { "netmask" : "255.255.255.0", "link" : "test", "id" : "test", "ip_address" : "192.168.122.201", "type" : "ipv4", "gateway" : "192.168.122.1" }, { "link" : "test", "id" : "test", "type" : "dhcp6" } ] }
the resulting network state object is
Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: !!python/unicode 'test': address: null gateway: null inet: inet mac_address: null mode: manual mtu: null name: !!python/unicode 'test' subnets:
When it should be
Internal State !!python/object:cloudinit.net.network_state.NetworkState _network_state: dns: nameservers: [] search: [] interfaces: !!python/unicode 'test': address: null gateway: null inet: inet mac_address: null mode: manual mtu: null name: !!python/unicode 'test' subnets:
It looks like this is caused by an error on line 570 of helpers/openstack.py where the test used is:
t = 'dhcp6' if network['type'].startswith('ipv6') else 'dhcp4'
which will always result in 'dhcp4' since the network type is 'dhcp6'
it looks like changing the test to
t = 'dhcp6' if network['type'].endswith('6') else 'dhcp4'
fixes things.