From 79b59658dfdc0172818c54e3c7149e6ed914a93b Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 15 Apr 2016 12:16:14 -0400 Subject: 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. --- bin/cloud-init | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') 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 -- cgit v1.2.3