Merge ~xnox/cloud-init:cidr into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 16a7302f6acb69adb0aee75eaf12392fa3688853 |
| Proposed branch: | ~xnox/cloud-init:cidr |
| Merge into: | cloud-init:master |
| Diff against target: |
81 lines (+12/-10) 4 files modified
cloudinit/net/netplan.py (+8/-6) cloudinit/net/network_state.py (+2/-2) tests/unittests/test_distros/test_netconfig.py (+1/-1) tests/unittests/test_net.py (+1/-1) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | Approve on 2017-05-24 | ||
| Server Team CI bot | continuous-integration | Approve on 2017-05-22 | |
| Ryan Harper | 2017-05-13 | Needs Fixing on 2017-05-15 | |
|
Review via email:
|
|||
Commit Message
netplan: generate cidr routes and netmasks.
LP: #1689346
| Ryan Harper (raharper) wrote : | # |
In both cases, use of mask2cidr when not a dotted quad will return the original string sent, but that will end up embedded strings instead of integers:
>>> network_
'24'
>>> network_
24
I think we either need to modify mask2cidr to do something else (convert to integer) so it it's consistent across input invocations, or if we don't change mask2cidr, then the callers need to handle all of the following
address = 192.168.1.2/24 , netmask: None
address = 192.168.
address = 192.168.1.2 , netmask: 24
address = 192.168.1.2 , netmask: 255.255.255.0
https:/
- 9e5cdbb... by Dimitri John Ledkov on 2017-05-16
PASSED: Continuous integration, rev:bd2954bc992
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:bf84def335f
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
FAILED: Continuous integration, rev:9e5cdbbd2d4
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
| Dimitri John Ledkov (xnox) wrote : | # |
Any idea why test_handler_
PASSED: Continuous integration, rev:9e5cdbbd2d4
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
| Scott Moser (smoser) wrote : | # |
I just re-built this at
https:/
and the i386 ran fine. obviously it wasn't a problem with Dimitri's code that triggered it.
It feels like a bug in cheetah or python. :(.
I've put the following diff in place:
diff --git a/cloudinit/
index b3ea64e..c24265a 100644
--- a/cloudinit/
+++ b/cloudinit/
@@ -76,6 +76,8 @@ def basic_render(
def detect_
def cheetah_
+ print("Calling CTemplate(%r, searchList=
+ (content, params))
return CTemplate(content, searchList=
def jinja_render(
And then run the failing test case like:
tox-venv py27 nosetests --nocapture -v tests/unittests
er_apt_
It shows:
test_disable_suites - disable_suites with many configurations ... Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
Calling CTemplate('foobar', searchList=
Calling CTemplate('foobar', searchList=
Calling CTemplate(
Calling CTemplate(
Calling CTemplate(
This is pretty straight forward usage of cheetah, the CTemplate is just
from Cheetah.Template import Template as CTemplate
I've also tried calling CTemplate with None in either or both positions and you end up with a different stack trace than above. All of this on both trusty and xenial i386.
I was running in lxc where as c-i runs in a vm.
| Scott Moser (smoser) wrote : | # |
I really want to clean up the 'network state' object.
It really should store only address and network_prefix and then renderers would render that to either a cidr or address and netmask.
note, i think that <address>/<netmask> is an abomination.
Ie:
good: 192.168.1.2/24
good: address=192.168.1.2 netmask: 255.255.255.0
bad: 192.168.
Wherever possible i want to warn or raise error on the bad above.
Rant aside, I'll grab this.


FAILED: Continuous integration, rev:678db0c7f5f 031725ba7262550 4e50c5c8f55936 /code.launchpad .net/~xnox/ cloud-init/ +git/cloud- init/+merge/ 324010/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 330/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/330 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/330 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- ppc64el/ 330 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/330
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild: /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 330/rebuild
https:/