From 516e378f0e79d127baeac8c6418efc504d3b713e Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Mon, 24 Jan 2011 19:51:57 +0000 Subject: move cloud-run-user-script.conf to cloud-final, use cloud-cfg for invoking This moves what was done as cloud-run-user-script.conf to 'cloud-final' and makes that re-use the cloud-init-cfg code, but simply with a different set of default configs. Also, adds keys_to_console and final_message cloud-config modules LP: #653271 --- cloudinit/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'cloudinit/__init__.py') diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index d5180c05..1786cc2f 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -20,6 +20,7 @@ varlibdir = '/var/lib/cloud' cur_instance_link = varlibdir + "/instance" +boot_finished = cur_instance_link + "/boot-finished" system_config = '/etc/cloud/cloud.cfg' seeddir = varlibdir + "/seed" cfg_env_name = "CLOUD_CFG" @@ -509,12 +510,15 @@ def initfs(): util.chownbyname(log_file, u, g) def purge_cache(): - try: - os.unlink(cur_instance_link) - except OSError as e: - if e.errno != errno.ENOENT: return(False) - except: - return(False) + rmlist = ( boot_finished , cur_instance_link ) + for f in rmlist: + try: + os.unlink(f) + except OSError as e: + if e.errno == errno.ENOENT: continue + return(False) + except: + return(False) return(True) # get_ipath_cur: get the current instance path for an item -- cgit v1.2.3