summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-01-29 10:09:25 -0500
committerScott Moser <smoser@ubuntu.com>2010-01-29 10:09:25 -0500
commit511448c7afdcb5aaeb69a26e570fd600df512610 (patch)
tree5d82df5d35c604d5c082d26d4480a1343d9caac7
parente6e30d8c8f72b904b34e93d2b9c4aef39b965b59 (diff)
downloadvyos-cloud-init-511448c7afdcb5aaeb69a26e570fd600df512610.tar.gz
vyos-cloud-init-511448c7afdcb5aaeb69a26e570fd600df512610.zip
make disable-ec2-metadata persistent across boots
The sem_and_run and such needs some work, donesn't make a lot of sense for "always".
-rw-r--r--ec2init/CloudConfig.py3
-rw-r--r--ec2init/__init__.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/ec2init/CloudConfig.py b/ec2init/CloudConfig.py
index 4875e999..d1699f09 100644
--- a/ec2init/CloudConfig.py
+++ b/ec2init/CloudConfig.py
@@ -38,7 +38,8 @@ class CloudConfig():
self.cloud.get_data_source()
self.add_handler('apt-update-upgrade', self.h_apt_update_upgrade)
self.add_handler('config-ssh')
- self.add_handler('disable-ec2-metadata')
+ self.add_handler('disable-ec2-metadata',
+ self.h_disable_ec2_metadata, "always")
self.add_handler('config-mounts')
def get_config_obj(self,cfgfile):
diff --git a/ec2init/__init__.py b/ec2init/__init__.py
index b88e3ddd..918b9280 100644
--- a/ec2init/__init__.py
+++ b/ec2init/__init__.py
@@ -162,6 +162,7 @@ class EC2Init:
return("%s/%s.%s" % (semdir,name,freqtok))
def sem_has_run(self,name,freq):
+ if freq is "always": return False
semfile = self.sem_getpath(name,freq)
if os.path.exists(semfile):
return True
@@ -177,7 +178,7 @@ class EC2Init:
if e.errno != errno.EEXIST:
raise e
- if os.path.exists(semfile):
+ if os.path.exists(semfile) and freq is not "always":
return False
# race condition