diff options
author | Scott Moser <smoser@ubuntu.com> | 2016-03-21 22:31:15 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2016-03-21 22:31:15 -0400 |
commit | 5fa9d4c3acbb4f7bf98a8eea7e121f3bc71ad7e0 (patch) | |
tree | 8f79ffffaa497c6efbc3104c1078f9d356034411 /bin | |
parent | 7a22e352b2f87636554d9787f60cd3168f3d77bc (diff) | |
parent | 4f2065ad569355d5d0bc54176bde6b8e55047341 (diff) | |
download | vyos-cloud-init-5fa9d4c3acbb4f7bf98a8eea7e121f3bc71ad7e0.tar.gz vyos-cloud-init-5fa9d4c3acbb4f7bf98a8eea7e121f3bc71ad7e0.zip |
merge from trunk
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cloud-init | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/bin/cloud-init b/bin/cloud-init index f101a713..63aa765b 100755 --- a/bin/cloud-init +++ b/bin/cloud-init @@ -212,6 +212,7 @@ def main_init(name, args): # Stage 4 path_helper = init.paths if not args.local: + existing = "trust" sys.stderr.write("%s\n" % (netinfo.debug_info())) LOG.debug(("Checking to see if files that we need already" " exist from a previous run that would allow us" @@ -236,21 +237,17 @@ def main_init(name, args): LOG.debug("Execution continuing, no previous run detected that" " would allow us to stop early.") else: - # The cache is not instance specific, so it has to be purged - # but we want 'start' to benefit from a cache if - # a previous start-local populated one... - manual_clean = util.get_cfg_option_bool(init.cfg, - 'manual_cache_clean', False) - if manual_clean: - LOG.debug("Not purging instance link, manual cleaning enabled") - init.purge_cache(False) - else: - init.purge_cache() + existing = "check" + if util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False): + existing = "trust" + + init.purge_cache() # Delete the non-net file as well util.del_file(os.path.join(path_helper.get_cpath("data"), "no-net")) + # Stage 5 try: - init.fetch() + init.fetch(existing=existing) except sources.DataSourceNotFoundException: # In the case of 'cloud-init init' without '--local' it is a bit # more likely that the user would consider it failure if nothing was |