summaryrefslogtreecommitdiff
path: root/cloudinit/cmd
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-02-04 02:25:19 +0000
committerScott Moser <smoser@brickies.net>2017-02-03 21:25:19 -0500
commite98709225510ee99ee0269c558c82b3e693e38e5 (patch)
treef81abe6b01f1a6215c26d551439b3032cac77f3b /cloudinit/cmd
parent9698b0ded3d7e72f54513f248d8da41e08472f68 (diff)
downloadvyos-cloud-init-e98709225510ee99ee0269c558c82b3e693e38e5.tar.gz
vyos-cloud-init-e98709225510ee99ee0269c558c82b3e693e38e5.zip
manual_cache_clean: When manually cleaning touch a file in instance dir.
When manual_cache_clean is enabled, write a file to /var/lib/cloud/instance/manual-clean. That file can then be read by ds-identify or another tool to indicate that manual cleaning is in place.
Diffstat (limited to 'cloudinit/cmd')
-rw-r--r--cloudinit/cmd/main.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
index 65b15edc..7c652574 100644
--- a/cloudinit/cmd/main.py
+++ b/cloudinit/cmd/main.py
@@ -312,8 +312,15 @@ def main_init(name, args):
" would allow us to stop early.")
else:
existing = "check"
- if util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False):
+ mcfg = util.get_cfg_option_bool(init.cfg, 'manual_cache_clean', False)
+ if mcfg:
+ LOG.debug("manual cache clean set from config")
existing = "trust"
+ else:
+ mfile = path_helper.get_ipath_cur("manual_clean_marker")
+ if os.path.exists(mfile):
+ LOG.debug("manual cache clean found from marker: %s", mfile)
+ existing = "trust"
init.purge_cache()
# Delete the non-net file as well