summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-04-15 12:16:14 -0400
committerScott Moser <smoser@ubuntu.com>2016-04-15 12:16:14 -0400
commit79b59658dfdc0172818c54e3c7149e6ed914a93b (patch)
treefc18874ab52399537f062aaf5c174d4c54de2a4a /cloudinit
parentf7d6eaef7311ac2484d48e67ec69e915b31e16e2 (diff)
downloadvyos-cloud-init-79b59658dfdc0172818c54e3c7149e6ed914a93b.tar.gz
vyos-cloud-init-79b59658dfdc0172818c54e3c7149e6ed914a93b.zip
only apply networking once per instance
This attempts to only apply the networking once per instance by doing so only if the datasource was restored from disk. This will work by default for datasources with a functioning check_instance_id or if the user has set manual_cache_clean to true.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/stages.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 3fbb4443..ffb15165 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -66,6 +66,7 @@ class Init(object):
self._distro = None
# Changed only when a fetch occurs
self.datasource = NULL_DATA_SOURCE
+ self.ds_restored = False
if reporter is None:
reporter = events.ReportEventStack(
@@ -80,6 +81,7 @@ class Init(object):
self._distro = None
if reset_ds:
self.datasource = NULL_DATA_SOURCE
+ self.ds_restored = False
@property
def distro(self):
@@ -231,6 +233,8 @@ class Init(object):
ds = None
else:
myrep.description = "no cache found"
+
+ self.ds_restored = bool(ds)
LOG.debug(myrep.description)
if not ds: