Merge ~smoser/cloud-init:feature/net-render-priority into cloud-init:master
| Status: | Merged |
|---|---|
| Merged at revision: | 5beecdf88b630a397b3722ddb299e9a37ff02737 |
| Proposed branch: | ~smoser/cloud-init:feature/net-render-priority |
| Merge into: | cloud-init:master |
| Diff against target: |
422 lines (+196/-34) 12 files modified
cloudinit/distros/__init__.py (+13/-0) cloudinit/distros/debian.py (+10/-13) cloudinit/distros/rhel.py (+1/-6) cloudinit/net/__init__.py (+5/-0) cloudinit/net/eni.py (+14/-0) cloudinit/net/renderer.py (+5/-0) cloudinit/net/renderers.py (+51/-0) cloudinit/net/sysconfig.py (+17/-0) cloudinit/settings.py (+1/-0) cloudinit/stages.py (+5/-1) cloudinit/util.py (+29/-14) tests/unittests/test_net.py (+45/-0) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Scott Moser | Approve on 2017-03-18 | ||
| Server Team CI bot | continuous-integration | Approve on 2017-03-18 | |
| Ryan Harper | 2017-03-17 | Approve on 2017-03-17 | |
|
Review via email:
|
|||
Commit Message
net: add renderers for automatically selecting the renderer.
Previously, the distro had hard coded which network renderer it would
use. This adds support for just picking the right renderer based
on what is available.
Now, that can be set via a priority in system_info, but should
generally work. That config looks like:
system_info:
network:
renderers: ["eni", "sysconfig"]
When no renderers are found, a specific RendererNotFoun
stages.py is modified to catch that and log it at error level. This
path should not really be exercised, but could occur if for example an
Ubuntu system did not have ifupdown, or a rhel system did not have
sysconfig. In such a system previously we would have quietly rendered
ENI configuration but that would have been ignored. This is one step
better in that we at least log the error.
| Ryan Harper (raharper) wrote : | # |
Add no renderer found exception and unittest as well.
PASSED: Continuous integration, rev:be71e3d895c
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:41a3d9cb9fb
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 think i've convinced you of /etc/network/
we both agree that currently our detection of "which networking system is used" is remedial, and will need improvement over time.
the tests you asked for are added now i think.
| Scott Moser (smoser) wrote : | # |
The change to raise a RuntimeError if there is no network renderer I think can cause a problem.
I'm trying to think through this, but in a situation where there is no ifupdown or sysconfig, previously we'd just write some files that were not going to do anything.
Ie, on ubuntu if you installed systemd-networkd and configured it to do something, and uninstalled ifupdown, then cloud-init would run and write ENI config, but if the system was configured to do the right thing ("dhcp on eth0" or whatever that was) then it might continue to work.
However, raising a RuntimeError here will throw exception up all the way through main.
currently cloudinit/
So that leaves me thinking of 2 options:
a.) change the raised RuntimeError to a NotImplementedError (which seems sane)
b.) change cloudinit/
I think for now, 'a' seems the best case because a RuntimeError seems like there couldb e more reasons for that to occur.
I'll also change the LOG.warn there to log what message it was (currently it didn't even print the exception's message.
FAILED: Continuous integration, rev:9048420e719
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
PASSED: Continuous integration, rev:8e71685cbe6
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 : | # |
in #cloud-init (https:/
I've re-written the commit message to describe all changes made and squashed to trunk.
I'm pulling this now.


PASSED: Continuous integration, rev:ca03a96953e 1c3d4cc33b7ec9e 2845c5cfebabf5 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ 129/ /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- amd64/129 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- arm64/129 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=metal- s390x/129 /jenkins. ubuntu. com/server/ job/cloud- init-ci/ nodes=vm- i386/129
https:/
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/ 129/rebuild
https:/