From 8ba08be9c27852aa2a40f1c6fbd497d95443eb3e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 7 Feb 2011 11:10:40 -0500 Subject: 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. --- cloudinit/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cloudinit') 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) -- cgit v1.2.3