summaryrefslogtreecommitdiff
path: root/bin
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 /bin
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 'bin')
-rwxr-xr-xbin/cloud-init4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/cloud-init b/bin/cloud-init
index 715be4b5..b449ac95 100755
--- a/bin/cloud-init
+++ b/bin/cloud-init
@@ -265,7 +265,9 @@ def main_init(name, args):
else:
return (None, ["No instance datasource found."])
- if args.local:
+ if args.local and 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()
# Stage 6