net renderers miss metric value in per-subnet routes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| cloud-init (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
When rendering a per-subnet route with a metric, the value is ignored due to clobbering of the looping variable.
Consider this v1 input:
{
"version": 1,
"config": [
{
"type": "physical",
"name": "eno3",
{
}
]
},
{
"type": "nameserver",
],
}
]
}
This should result in a netplan where we have a route entry with the correct gateway value and the metric, like this:
network:
version: 2
ethernets:
eno3:
- 192.168.14.13/24
match:
- 8.8.8.8
routes:
- metric: 10000
to: 192.168.14.0/24
via: 192.168.14.254
But instead, we get this:
network:
version: 2
ethernets:
eno3:
- 192.168.14.13/24
match:
- 8.8.8.8
routes:
- to: 192.168.14.0/24
via: 192.168.14.254
The bug is in here in _extract_addresses in cloudinit/
for route in subnet.
}
if 'metric' in route:
Related branches
- Server Team CI bot: Approve (continuous-integration) on 2018-12-14
- cloud-init Commiters: Pending requested 2018-12-14
-
Diff: 1245 lines (+556/-145)23 files modifiedChangeLog (+54/-0)
bash_completion/cloud-init (+4/-1)
cloudinit/cmd/devel/net_convert.py (+10/-5)
cloudinit/cmd/main.py (+4/-16)
cloudinit/config/cc_write_files.py (+6/-1)
cloudinit/dhclient_hook.py (+72/-38)
cloudinit/net/eni.py (+15/-14)
cloudinit/net/netplan.py (+3/-3)
cloudinit/net/sysconfig.py (+21/-4)
cloudinit/sources/DataSourceAzure.py (+2/-2)
cloudinit/sources/DataSourceNoCloud.py (+31/-1)
cloudinit/sources/helpers/vmware/imc/config_nic.py (+2/-3)
cloudinit/tests/test_dhclient_hook.py (+105/-0)
cloudinit/version.py (+1/-1)
config/cloud.cfg.tmpl (+11/-1)
debian/changelog (+16/-0)
tests/cloud_tests/releases.yaml (+16/-0)
tests/unittests/test_cli.py (+8/-8)
tests/unittests/test_datasource/test_nocloud.py (+66/-34)
tests/unittests/test_handler/test_handler_write_files.py (+12/-0)
tests/unittests/test_net.py (+44/-6)
tests/unittests/test_vmware_config_file.py (+52/-6)
tox.ini (+1/-1)
- Chad Smith: Approve on 2018-12-11
- Server Team CI bot: Approve (continuous-integration) on 2018-12-05
-
Diff: 255 lines (+83/-27)4 files modifiedcloudinit/net/eni.py (+15/-14)
cloudinit/net/netplan.py (+3/-3)
cloudinit/net/sysconfig.py (+21/-4)
tests/unittests/test_net.py (+44/-6)
Ryan Harper (raharper) wrote : | #1 |
summary: |
- netplan renderer misses metric value in per-subnet routes + net renderers miss metric value in per-subnet routes |
Ryan Harper (raharper) wrote : | #2 |
*renderers*
This bug is fixed with commit 6aef6c7d to cloud-init on branch master.
To view that commit see the following URL:
https:/
Launchpad Janitor (janitor) wrote : | #4 |
This bug was fixed in the package cloud-init - 18.5-1-
---------------
cloud-init (18.5-1-
* New upstream snapshot.
- Update to pylint 2.2.2.
- Release 18.5 (LP: #1808380)
- tests: add Disco release [Joshua Powers]
- net: render 'metric' values in per-subnet routes (LP: #1805871)
- write_files: add support for appending to files. [James Baxter]
- config: On ubuntu select cloud archive mirrors for armel, armhf, arm64.
(LP: #1805854)
- dhclient-hook: cleanups, tests and fix a bug on 'down' event.
- NoCloud: Allow top level 'network' key in network-config. (LP: #1798117)
- ovf: Fix ovf network config generation gateway/routes (LP: #1806103)
-- Ryan Harper <email address hidden> Fri, 14 Dec 2018 14:45:46 -0600
Changed in cloud-init (Ubuntu): | |
status: | New → Fix Released |
Note, this also affects the eni and sysconfig router as well.