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 /bin | |
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 'bin')
-rwxr-xr-x | bin/cloud-init | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/cloud-init b/bin/cloud-init index 715be4b5..5857af32 100755 --- a/bin/cloud-init +++ b/bin/cloud-init @@ -266,7 +266,12 @@ def main_init(name, args): return (None, ["No instance datasource found."]) if args.local: - init.apply_network_config() + if not init.ds_restored: + # if local mode and the datasource was not restored from cache + # (this is not first boot) then apply networking. + init.apply_network_config() + else: + LOG.debug("skipping networking config from restored datasource.") # Stage 6 iid = init.instancify() |