tools/net-convert: fix argument order for render_network_state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Low
|
Dimitri John Ledkov | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
Rendering of netplan content was broken due to an incorrect
function signature in net/netplan.
The end result was that rendering of netplan configuration was
broken in actual usage. Note, though that no official Ubuntu images
use this path at the current time. Ubuntu image all use ifupdown.
[Test Case]
The basic idea below is:
a.) launch an instance with proposed version of cloud-init.
b.) inside instance, run the test case. That would stack trace
as seen in the bug on prior versions of cloud-init.
c.) show the output.
## launch an instance.
$ release=xenial
$ ref=$release-
$ lxc-proposed-
$ lxc launch $ref $name
$ lxc exec $name
% cat > render-test.py <<"EOF"
#!/usr/bin/python3
import sys
from cloudinit.net import netplan, eni, network_state
out_d = "./out.d" if len(sys.argv) < 2 else sys.argv[1]
cfg = {'version': 1,
'config': [{'name': 'eth1', 'type': 'physical',
# Render eni and netplan to show that they both work.
ns = network_
for renderer in netplan.Renderer(), eni.Renderer():
print(
renderer.
EOF
$ python3 render-test.py out.d
Rendering <cloudinit.
Rendering <cloudinit.
$ ( cd out.d && for f in $(find . -type f); do echo == $f ==; cat $f; done )
== ./etc/network/
auto lo
iface lo inet loopback
auto eth1
iface eth1 inet dhcp
== ./etc/netplan/
network:
version: 2
ethernets:
eth1:
dhcp4: true
== ./etc/udev/
$ dpkg-query --show cloud-init
[Regression Potential]
This specific change has basically zero regression potential as it
was in netplan specific path that was only previously excercised
with test cases.
[Other Info]
Upstream commit at
https:/
lxc-proposed-
https:/
It publishes an image to lxd with proposed enabled and cloud-init upgraded.
=== End SRU Template ===
% cat simple-v2.yaml
network:
version: 2
# comment above ethernets
ethernets:
ens0:
dhcp4: true
match:
set-name: ens0
switchports:
# all cards on second PCI bus; unconfigured by themselves, will be added
# to br0 below
match:
name: enp2*
mtu: 1280
% PYTHONPATH=`pwd` ./tools/
Traceback (most recent call last):
File "./tools/
main()
File "./tools/
r.render_
TypeError: render_
This is broken on master.
Related branches
- Server Team CI bot: Approve (continuous-integration)
- cloud-init Commiters: Pending requested
-
Diff: 13 lines (+1/-1)1 file modifiedtools/net-convert.py (+1/-1)
Changed in cloud-init: | |
status: | New → Confirmed |
no longer affects: | cloud-init (Ubuntu) |
Changed in cloud-init: | |
importance: | Undecided → Low |
status: | Confirmed → Fix Committed |
Changed in cloud-init: | |
status: | Fix Committed → In Progress |
Changed in cloud-init (Ubuntu): | |
status: | New → Fix Released |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Zesty): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Zesty): | |
importance: | Undecided → Medium |
description: | updated |
this attachment can be run from trunk and shows the stack trace. convert. py.
It just picks a config (from bug 1691135) and renders it to ENI and netplan with tools/net-