summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/net/__init__.py4
-rw-r--r--cloudinit/sources/DataSourceNoCloud.py1
-rw-r--r--cloudinit/stages.py5
3 files changed, 7 insertions, 3 deletions
diff --git a/cloudinit/net/__init__.py b/cloudinit/net/__init__.py
index 57beb837..40929c6e 100644
--- a/cloudinit/net/__init__.py
+++ b/cloudinit/net/__init__.py
@@ -407,7 +407,7 @@ def render_persistent_net(network_state):
for iface in interfaces.values():
# for physical interfaces write out a persist net udev rule
if iface['type'] == 'physical' and \
- 'name' in iface and 'mac_address' in iface:
+ 'name' in iface and iface.get('mac_address'):
content += generate_udev_rule(iface['name'],
iface['mac_address'])
@@ -598,7 +598,7 @@ def render_systemd_links(target, network_state,
interfaces = network_state.get('interfaces')
for iface in interfaces.values():
if (iface['type'] == 'physical' and 'name' in iface and
- 'mac_address' in iface):
+ iface.get('mac_address')):
fname = fp_prefix + iface['name'] + ".link"
with open(fname, "w") as fp:
fp.write("\n".join([
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index 802d515b..c2fba4d2 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -316,7 +316,6 @@ class DataSourceNoCloudNet(DataSourceNoCloud):
DataSourceNoCloud.__init__(self, sys_cfg, distro, paths)
self.cmdline_id = "ds=nocloud-net"
self.supported_seed_starts = ("http://", "https://", "ftp://")
- self.seed_dirs = [os.path.join(paths.seed_dir, 'nocloud-net')]
self.dsmode = "net"
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 5d6b0447..143a4fc9 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -570,6 +570,11 @@ class Init(object):
self._do_handlers(user_data_msg, c_handlers_list, frequency)
def _find_networking_config(self):
+ disable_file = os.path.join(
+ self.paths.get_cpath('data'), 'upgraded-network')
+ if os.path.exists(disable_file):
+ return (None, disable_file)
+
cmdline_cfg = ('cmdline', net.read_kernel_cmdline_config())
dscfg = ('ds', None)
if self.datasource and hasattr(self.datasource, 'network_config'):