summaryrefslogtreecommitdiff
path: root/cloudinit/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-02-07 11:10:40 -0500
committerScott Moser <smoser@ubuntu.com>2011-02-07 11:10:40 -0500
commit8ba08be9c27852aa2a40f1c6fbd497d95443eb3e (patch)
tree969f678e6374d00c1f943228589242f074119fae /cloudinit/__init__.py
parent7077e1481ee22d99126ceb011b8819bd1a23487c (diff)
downloadvyos-cloud-init-8ba08be9c27852aa2a40f1c6fbd497d95443eb3e.tar.gz
vyos-cloud-init-8ba08be9c27852aa2a40f1c6fbd497d95443eb3e.zip
add config option 'manual_cache_clean'.
This option allows user to specify manual cleaning of the /var/lib/cloud/instance/ link, for a data source that might not be present on every boot.
Diffstat (limited to 'cloudinit/__init__.py')
-rw-r--r--cloudinit/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
index 99cc4d46..02147461 100644
--- a/cloudinit/__init__.py
+++ b/cloudinit/__init__.py
@@ -501,8 +501,9 @@ def initfs():
if g == "-1" or g == "None": g = None
util.chownbyname(log_file, u, g)
-def purge_cache():
- rmlist = ( boot_finished , cur_instance_link )
+def purge_cache(rmcur=True):
+ rmlist = [ boot_finished ]
+ if rmcur: rmlist.append(cur_instance_link)
for f in rmlist:
try:
os.unlink(f)