summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoren Hansen <soren@canonical.com>2009-06-27 20:07:35 +0200
committerSoren Hansen <soren@canonical.com>2009-06-27 20:07:35 +0200
commit78186f48d3c403ed0eb52b6415b3785584c772fc (patch)
treed4a0bee9d5d36467ea089d6525e8ba8752d6c7af
parent762239981d70e209c69e9d00f6204fd2d9343bf0 (diff)
downloadvyos-cloud-init-78186f48d3c403ed0eb52b6415b3785584c772fc.tar.gz
vyos-cloud-init-78186f48d3c403ed0eb52b6415b3785584c772fc.zip
Rely on the lockfile handling in the init script, and let ec2-run-user-data just do its thing.
-rwxr-xr-xec2-run-user-data.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/ec2-run-user-data.py b/ec2-run-user-data.py
index 8e16cefd..51e0d68d 100755
--- a/ec2-run-user-data.py
+++ b/ec2-run-user-data.py
@@ -31,23 +31,10 @@ content_type_handlers = { 'text/x-shellscript' : handle_shell_script,
def main():
ec2 = ec2init.EC2Init()
- semaphore = '/var/lib/ec2/already-ran.%s' % amiId
- amiId = ec2.get_ami_id()
-
- if os.path.exists(semaphore):
- print "ec2-run-user-data already ran for this instance."
- return 0
-
user_data = ec2.get_user_data()
msg = email.message_from_string(user_data)
- if msg.is_multipart():
- handle_part(msg)
- else:
- handle_payload(user_data)
-
- # Touch the semaphore file
- file(semaphore, 'a').close()
+ handle_part(msg)
def handle_part(part):
if part.is_multipart():