Merge ~raharper/cloud-init:ubuntu-devel-new-artful-release-v7 into cloud-init:ubuntu/devel

Proposed by Ryan Harper on 2017-10-05
Status: Rejected
Rejected by: Scott Moser on 2017-10-05
Proposed branch: ~raharper/cloud-init:ubuntu-devel-new-artful-release-v7
Merge into: cloud-init:ubuntu/devel
Diff against target: 163 lines (+37/-8)
8 files modified
cloudinit/net/eni.py (+3/-0)
cloudinit/net/netplan.py (+3/-2)
cloudinit/net/network_state.py (+15/-2)
debian/changelog (+9/-0)
tests/unittests/test_net.py (+3/-2)
tools/make-tarball (+1/-1)
tools/read-version (+1/-1)
tox.ini (+2/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve on 2017-10-05
cloud-init Commiters 2017-10-05 Pending
Review via email: mp+331892@code.launchpad.net

Description of the change

cloud-init (17.1-16-g6eb4dc24-0ubuntu1) artful; urgency=medium

  * New upstream snapshot.
    - tools: Give specific --abbrev=8 to "git describe"
    - network: bridge_stp value not always correct [Ryan Harper] (LP: #1721157)
    - tests: re-enable tox with nocloud-kvm support [Joshua Powers]

 -- Ryan Harper <email address hidden> Thu, 05 Oct 2017 13:46:43 -0500

To post a comment you must log in.

PASSED: Continuous integration, rev:43ad5a6980d3548e9b6a30b227bd7efe7a2de27f
https://jenkins.ubuntu.com/server/job/cloud-init-ci/387/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/387/rebuild

review: Approve (continuous-integration)
Chad Smith (chad.smith) :
Chad Smith (chad.smith) :
Scott Moser (smoser) wrote :

based on chads review we put another commit in trunk and will upload with that fix.

Unmerged commits

43ad5a6... by Ryan Harper on 2017-10-05

releasing package cloud-init version 17.1-16-g6eb4dc24-0ubuntu1

3574e31... by Ryan Harper on 2017-10-05

update changelog (new upstream snapshot 17.1-16-g6eb4dc24).

c9945cb... by Ryan Harper on 2017-10-05

merge from master at 17.1-16-g6eb4dc24

6eb4dc2... by Scott Moser on 2017-10-05

tools: Give specific --abbrev=8 to "git describe"

The tools that use "git describe" were just assuming a consisent
number of characters in the hash. It seems ubuntu 16.04 would use 7
and later versions use 8. To avoid that discrepency in developer
environments, set it to 8.

57e2e01... by Ryan Harper on 2017-10-03

network: bridge_stp value not always correct

Update network_state to store the bridge_stp value as a boolean.
The various renderers then can map the boolean value to the correct
output as needed; eni uses 'on/off', sysconfig uses 'yes/no' and
netplan will use the boolean directly.

Update unittest values for sysconfig and netplan. Both contained the
network_state string value which resulted in not correctly enable/disable
STP in the target system.

Update network_state comment (fd -> forward-delay, add stp as boolean) on
bridge commands to match the expected format of a netplan bridge command.

LP: #1721157

aa024e3... by Joshua Powers on 2017-10-03

tests: re-enable tox with nocloud-kvm support

With the addition of the nocloud-kvm support a few other python modules
were pulled in as required and as a result this broke the tox run. The
fix was to add paramiko and simplestreams to re-enable testing.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
2index bb80ec0..c6a71d1 100644
3--- a/cloudinit/net/eni.py
4+++ b/cloudinit/net/eni.py
5@@ -95,6 +95,9 @@ def _iface_add_attrs(iface, index):
6 ignore_map.append('mac_address')
7
8 for key, value in iface.items():
9+ # convert bool to string for eni
10+ if type(value) == bool:
11+ value = 'on' if iface[key] else 'off'
12 if not value or key in ignore_map:
13 continue
14 if key in multiline_keys:
15diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py
16index 3b06fbf..d3788af 100644
17--- a/cloudinit/net/netplan.py
18+++ b/cloudinit/net/netplan.py
19@@ -244,9 +244,9 @@ class Renderer(renderer.Renderer):
20
21 for config in network_state.iter_interfaces():
22 ifname = config.get('name')
23- # filter None entries up front so we can do simple if key in dict
24+ # filter None (but not False) entries up front
25 ifcfg = dict((key, value) for (key, value) in config.items()
26- if value)
27+ if value is not None)
28
29 if_type = ifcfg.get('type')
30 if if_type == 'physical':
31@@ -318,6 +318,7 @@ class Renderer(renderer.Renderer):
32 (port, cost) = costval.split()
33 newvalue[port] = int(cost)
34 br_config.update({newname: newvalue})
35+
36 if len(br_config) > 0:
37 bridge.update({'parameters': br_config})
38 _extract_addresses(ifcfg, bridge)
39diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
40index 6faf01b..890dbf8 100644
41--- a/cloudinit/net/network_state.py
42+++ b/cloudinit/net/network_state.py
43@@ -48,6 +48,7 @@ NET_CONFIG_TO_V2 = {
44 'bridge_maxwait': None,
45 'bridge_pathcost': 'path-cost',
46 'bridge_portprio': None,
47+ 'bridge_stp': 'stp',
48 'bridge_waitport': None}}
49
50
51@@ -465,6 +466,18 @@ class NetworkStateInterpreter(object):
52 for param, val in command.get('params', {}).items():
53 iface.update({param: val})
54
55+ # convert value to boolean
56+ bridge_stp = iface.get('bridge_stp')
57+ if bridge_stp and type(bridge_stp) != bool:
58+ if bridge_stp in ['on', '1', 1]:
59+ bridge_stp = True
60+ elif bridge_stp in ['off', '0', 0]:
61+ bridge_stp = False
62+ else:
63+ raise ValueError("Cannot convert bridge_stp value"
64+ "(%s) to boolean", bridge_stp)
65+ iface.update({'bridge_stp': bridge_stp})
66+
67 interfaces.update({iface['name']: iface})
68
69 @ensure_command_keys(['address'])
70@@ -525,8 +538,8 @@ class NetworkStateInterpreter(object):
71 v2_command = {
72 br0: {
73 'interfaces': ['interface0', 'interface1'],
74- 'fd': 0,
75- 'stp': 'off',
76+ 'forward-delay': 0,
77+ 'stp': False,
78 'maxwait': 0,
79 }
80 }
81diff --git a/debian/changelog b/debian/changelog
82index d2207b6..0a5901c 100644
83--- a/debian/changelog
84+++ b/debian/changelog
85@@ -1,3 +1,12 @@
86+cloud-init (17.1-16-g6eb4dc24-0ubuntu1) artful; urgency=medium
87+
88+ * New upstream snapshot.
89+ - tools: Give specific --abbrev=8 to "git describe"
90+ - network: bridge_stp value not always correct [Ryan Harper] (LP: #1721157)
91+ - tests: re-enable tox with nocloud-kvm support [Joshua Powers]
92+
93+ -- Ryan Harper <ryan.harper@canonical.com> Thu, 05 Oct 2017 13:46:43 -0500
94+
95 cloud-init (17.1-13-g7fd04255-0ubuntu1) artful; urgency=medium
96
97 * debian/copyright: dep5 updates, reorganize, add Apache 2.0 license.
98diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
99index f249615..17c9342 100644
100--- a/tests/unittests/test_net.py
101+++ b/tests/unittests/test_net.py
102@@ -756,6 +756,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
103 eth3: 50
104 eth4: 75
105 priority: 22
106+ stp: false
107 routes:
108 - to: ::/0
109 via: 2001:4800:78ff:1b::1
110@@ -820,7 +821,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
111 NM_CONTROLLED=no
112 ONBOOT=yes
113 PRIO=22
114- STP=off
115+ STP=no
116 TYPE=Bridge
117 USERCTL=no"""),
118 'ifcfg-eth0': textwrap.dedent("""\
119@@ -1296,7 +1297,7 @@ pre-down route del -net 10.0.0.0 netmask 255.0.0.0 gw 11.0.0.1 metric 3 || true
120 NM_CONTROLLED=no
121 ONBOOT=yes
122 PRIO=22
123- STP=off
124+ STP=no
125 TYPE=Bridge
126 USERCTL=no
127 """),
128diff --git a/tools/make-tarball b/tools/make-tarball
129index 91c4562..3197689 100755
130--- a/tools/make-tarball
131+++ b/tools/make-tarball
132@@ -35,7 +35,7 @@ while [ $# -ne 0 ]; do
133 done
134
135 rev=${1:-HEAD}
136-version=$(git describe "--match=[0-9]*" ${long_opt} $rev)
137+version=$(git describe --abbrev=8 "--match=[0-9]*" ${long_opt} $rev)
138
139 archive_base="cloud-init-$version"
140 if [ -z "$output" ]; then
141diff --git a/tools/read-version b/tools/read-version
142index ddb2838..d9ed30d 100755
143--- a/tools/read-version
144+++ b/tools/read-version
145@@ -56,7 +56,7 @@ if os.path.isdir(os.path.join(_tdir, ".git")) and which("git"):
146 flags = []
147 if use_tags:
148 flags = ['--tags']
149- cmd = ['git', 'describe', '--match=[0-9]*'] + flags
150+ cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
151
152 version = tiny_p(cmd).strip()
153
154diff --git a/tox.ini b/tox.ini
155index aef1f84..9223220 100644
156--- a/tox.ini
157+++ b/tox.ini
158@@ -132,3 +132,5 @@ commands = {envpython} -m tests.cloud_tests {posargs}
159 passenv = HOME
160 deps =
161 pylxd==2.2.4
162+ paramiko==2.3.1
163+ bzr+lp:simplestreams

Subscribers

People subscribed via source and target branches