From 30d8a1f2336f9e05b047136903d47025fdf28f5a Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 29 Mar 2016 13:43:14 -0400 Subject: apply_network_config improvements 3 things here: a.) do not raise exception, only warn when trying to apply a network config for a distro that does not have an implementation. This is important since debian/ubuntu is the only one *with* an implementation at the moment b.) apply network config in 'cloud-init --local' even if there is no datasource found. c.) do not write 70-persistent-net.rules the code was writing both 70-persistent-net.rules and /etc/systemd/network/50-cloud-init-*.link files that would just be confusing. --- cloudinit/stages.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cloudinit/stages.py') diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 143a4fc9..3fbb4443 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -596,7 +596,13 @@ class Init(object): return LOG.info("Applying network configuration from %s: %s", src, netcfg) - return self.distro.apply_network_config(netcfg) + try: + return self.distro.apply_network_config(netcfg) + except NotImplementedError: + LOG.warn("distro '%s' does not implement apply_network_config. " + "networking may not be configured properly." % + self.distro) + return class Modules(object): -- cgit v1.2.3