summaryrefslogtreecommitdiff
path: root/cloudinit/net/dhcp.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-11-20 15:56:40 -0500
committerScott Moser <smoser@brickies.net>2017-11-20 15:56:40 -0500
commit281a82181716183d526e76f4e0415e0a6f680cbe (patch)
treecf617a96b41289112787dcef23b358bf5e63c8f9 /cloudinit/net/dhcp.py
parentd3a0958c09c73a78fda6e922b749a1b98036e984 (diff)
downloadvyos-cloud-init-281a82181716183d526e76f4e0415e0a6f680cbe.tar.gz
vyos-cloud-init-281a82181716183d526e76f4e0415e0a6f680cbe.zip
EC2: Fix bug using fallback_nic and metadata when restoring from cache.
If user upgraded to new cloud-init and attempted to run 'cloud-init init' without rebooting, cloud-init restores the datasource object from pickle. The older version pickled datasource object had no value for _network_config or fallback_nic. This caused the Ec2 datasource to attempt to reconfigure networking with a None fallback_nic. The pickled object also cached an older version of ec2 metadata which didn't contain network information. This branch does two things: - Add a fallback_interface property to DatasourceEC2 to support reading the old .fallback_nic attribute if it was set. New versions will call net.find_fallback_nic() if there has not been one found. - Re-crawl metadata if we are on Ec2 and don't have a 'network' key in metadata LP: #1732917
Diffstat (limited to 'cloudinit/net/dhcp.py')
-rw-r--r--cloudinit/net/dhcp.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/cloudinit/net/dhcp.py b/cloudinit/net/dhcp.py
index f3a412a9..d8624d82 100644
--- a/cloudinit/net/dhcp.py
+++ b/cloudinit/net/dhcp.py
@@ -42,8 +42,7 @@ def maybe_perform_dhcp_discovery(nic=None):
if nic is None:
nic = find_fallback_nic()
if nic is None:
- LOG.debug(
- 'Skip dhcp_discovery: Unable to find fallback nic.')
+ LOG.debug('Skip dhcp_discovery: Unable to find fallback nic.')
return {}
elif nic not in get_devicelist():
LOG.debug(