diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-04-15 13:58:13 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-04-15 13:58:13 -0400 |
commit | 53f035122dffd5b821e29fe9af9a72276d9728b4 (patch) | |
tree | 7322e5b0a164774170e8b1d60eae8d07c99efd8f /cloudinit | |
parent | f7d6eaef7311ac2484d48e67ec69e915b31e16e2 (diff) | |
parent | 53931ee132f0d236e3ed1b7fd6e0e0b519f40bda (diff) | |
download | vyos-cloud-init-53f035122dffd5b821e29fe9af9a72276d9728b4.tar.gz vyos-cloud-init-53f035122dffd5b821e29fe9af9a72276d9728b4.zip |
apply networking less often
Do not apply networking configuration whenever a previous datasource
has been loaded from disk and found to be valid (via positive
return 'check_instance_id' or user configuration of manual_cache_clean).
This effectively means that we apply fallback networking only once
per instance rather than every boot on any datasource with
'check_instance_id' implemented.
LP: #1571004
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/stages.py | 4 |
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: |