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

Proposed by Ryan Harper
Status: Rejected
Rejected by: Scott Moser
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
cloud-init Commiters 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.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

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)
Revision history for this message
Chad Smith (chad.smith) :
Revision history for this message
Chad Smith (chad.smith) :
Revision history for this message
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

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

3574e31... by Ryan Harper

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

c9945cb... by Ryan Harper

merge from master at 17.1-16-g6eb4dc24

6eb4dc2... by Scott Moser

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

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

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
diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
index bb80ec0..c6a71d1 100644
--- a/cloudinit/net/eni.py
+++ b/cloudinit/net/eni.py
@@ -95,6 +95,9 @@ def _iface_add_attrs(iface, index):
95 ignore_map.append('mac_address')95 ignore_map.append('mac_address')
9696
97 for key, value in iface.items():97 for key, value in iface.items():
98 # convert bool to string for eni
99 if type(value) == bool:
100 value = 'on' if iface[key] else 'off'
98 if not value or key in ignore_map:101 if not value or key in ignore_map:
99 continue102 continue
100 if key in multiline_keys:103 if key in multiline_keys:
diff --git a/cloudinit/net/netplan.py b/cloudinit/net/netplan.py
index 3b06fbf..d3788af 100644
--- a/cloudinit/net/netplan.py
+++ b/cloudinit/net/netplan.py
@@ -244,9 +244,9 @@ class Renderer(renderer.Renderer):
244244
245 for config in network_state.iter_interfaces():245 for config in network_state.iter_interfaces():
246 ifname = config.get('name')246 ifname = config.get('name')
247 # filter None entries up front so we can do simple if key in dict247 # filter None (but not False) entries up front
248 ifcfg = dict((key, value) for (key, value) in config.items()248 ifcfg = dict((key, value) for (key, value) in config.items()
249 if value)249 if value is not None)
250250
251 if_type = ifcfg.get('type')251 if_type = ifcfg.get('type')
252 if if_type == 'physical':252 if if_type == 'physical':
@@ -318,6 +318,7 @@ class Renderer(renderer.Renderer):
318 (port, cost) = costval.split()318 (port, cost) = costval.split()
319 newvalue[port] = int(cost)319 newvalue[port] = int(cost)
320 br_config.update({newname: newvalue})320 br_config.update({newname: newvalue})
321
321 if len(br_config) > 0:322 if len(br_config) > 0:
322 bridge.update({'parameters': br_config})323 bridge.update({'parameters': br_config})
323 _extract_addresses(ifcfg, bridge)324 _extract_addresses(ifcfg, bridge)
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py
index 6faf01b..890dbf8 100644
--- a/cloudinit/net/network_state.py
+++ b/cloudinit/net/network_state.py
@@ -48,6 +48,7 @@ NET_CONFIG_TO_V2 = {
48 'bridge_maxwait': None,48 'bridge_maxwait': None,
49 'bridge_pathcost': 'path-cost',49 'bridge_pathcost': 'path-cost',
50 'bridge_portprio': None,50 'bridge_portprio': None,
51 'bridge_stp': 'stp',
51 'bridge_waitport': None}}52 'bridge_waitport': None}}
5253
5354
@@ -465,6 +466,18 @@ class NetworkStateInterpreter(object):
465 for param, val in command.get('params', {}).items():466 for param, val in command.get('params', {}).items():
466 iface.update({param: val})467 iface.update({param: val})
467468
469 # convert value to boolean
470 bridge_stp = iface.get('bridge_stp')
471 if bridge_stp and type(bridge_stp) != bool:
472 if bridge_stp in ['on', '1', 1]:
473 bridge_stp = True
474 elif bridge_stp in ['off', '0', 0]:
475 bridge_stp = False
476 else:
477 raise ValueError("Cannot convert bridge_stp value"
478 "(%s) to boolean", bridge_stp)
479 iface.update({'bridge_stp': bridge_stp})
480
468 interfaces.update({iface['name']: iface})481 interfaces.update({iface['name']: iface})
469482
470 @ensure_command_keys(['address'])483 @ensure_command_keys(['address'])
@@ -525,8 +538,8 @@ class NetworkStateInterpreter(object):
525 v2_command = {538 v2_command = {
526 br0: {539 br0: {
527 'interfaces': ['interface0', 'interface1'],540 'interfaces': ['interface0', 'interface1'],
528 'fd': 0,541 'forward-delay': 0,
529 'stp': 'off',542 'stp': False,
530 'maxwait': 0,543 'maxwait': 0,
531 }544 }
532 }545 }
diff --git a/debian/changelog b/debian/changelog
index d2207b6..0a5901c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
1cloud-init (17.1-16-g6eb4dc24-0ubuntu1) artful; urgency=medium
2
3 * New upstream snapshot.
4 - tools: Give specific --abbrev=8 to "git describe"
5 - network: bridge_stp value not always correct [Ryan Harper] (LP: #1721157)
6 - tests: re-enable tox with nocloud-kvm support [Joshua Powers]
7
8 -- Ryan Harper <ryan.harper@canonical.com> Thu, 05 Oct 2017 13:46:43 -0500
9
1cloud-init (17.1-13-g7fd04255-0ubuntu1) artful; urgency=medium10cloud-init (17.1-13-g7fd04255-0ubuntu1) artful; urgency=medium
211
3 * debian/copyright: dep5 updates, reorganize, add Apache 2.0 license.12 * debian/copyright: dep5 updates, reorganize, add Apache 2.0 license.
diff --git a/tests/unittests/test_net.py b/tests/unittests/test_net.py
index f249615..17c9342 100644
--- a/tests/unittests/test_net.py
+++ b/tests/unittests/test_net.py
@@ -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
756 eth3: 50756 eth3: 50
757 eth4: 75757 eth4: 75
758 priority: 22758 priority: 22
759 stp: false
759 routes:760 routes:
760 - to: ::/0761 - to: ::/0
761 via: 2001:4800:78ff:1b::1762 via: 2001:4800:78ff:1b::1
@@ -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
820 NM_CONTROLLED=no821 NM_CONTROLLED=no
821 ONBOOT=yes822 ONBOOT=yes
822 PRIO=22823 PRIO=22
823 STP=off824 STP=no
824 TYPE=Bridge825 TYPE=Bridge
825 USERCTL=no"""),826 USERCTL=no"""),
826 'ifcfg-eth0': textwrap.dedent("""\827 'ifcfg-eth0': textwrap.dedent("""\
@@ -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
1296 NM_CONTROLLED=no1297 NM_CONTROLLED=no
1297 ONBOOT=yes1298 ONBOOT=yes
1298 PRIO=221299 PRIO=22
1299 STP=off1300 STP=no
1300 TYPE=Bridge1301 TYPE=Bridge
1301 USERCTL=no1302 USERCTL=no
1302 """),1303 """),
diff --git a/tools/make-tarball b/tools/make-tarball
index 91c4562..3197689 100755
--- a/tools/make-tarball
+++ b/tools/make-tarball
@@ -35,7 +35,7 @@ while [ $# -ne 0 ]; do
35done35done
3636
37rev=${1:-HEAD}37rev=${1:-HEAD}
38version=$(git describe "--match=[0-9]*" ${long_opt} $rev)38version=$(git describe --abbrev=8 "--match=[0-9]*" ${long_opt} $rev)
3939
40archive_base="cloud-init-$version"40archive_base="cloud-init-$version"
41if [ -z "$output" ]; then41if [ -z "$output" ]; then
diff --git a/tools/read-version b/tools/read-version
index ddb2838..d9ed30d 100755
--- a/tools/read-version
+++ b/tools/read-version
@@ -56,7 +56,7 @@ if os.path.isdir(os.path.join(_tdir, ".git")) and which("git"):
56 flags = []56 flags = []
57 if use_tags:57 if use_tags:
58 flags = ['--tags']58 flags = ['--tags']
59 cmd = ['git', 'describe', '--match=[0-9]*'] + flags59 cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
6060
61 version = tiny_p(cmd).strip()61 version = tiny_p(cmd).strip()
6262
diff --git a/tox.ini b/tox.ini
index aef1f84..9223220 100644
--- a/tox.ini
+++ b/tox.ini
@@ -132,3 +132,5 @@ commands = {envpython} -m tests.cloud_tests {posargs}
132passenv = HOME132passenv = HOME
133deps =133deps =
134 pylxd==2.2.4134 pylxd==2.2.4
135 paramiko==2.3.1
136 bzr+lp:simplestreams

Subscribers

People subscribed via source and target branches