summaryrefslogtreecommitdiff
path: root/ec2-init.py
diff options
context:
space:
mode:
authorScott Moser <smoser@nelson>2010-01-07 16:07:01 -0500
committerScott Moser <smoser@nelson>2010-01-07 16:07:01 -0500
commit49d3df468a94fef41a036dfa5d886449d180e006 (patch)
tree45dccadb6bef5621eac2d692e893e6ff8aeccae8 /ec2-init.py
parent44e69ea67e75241dce3230f755c13ab602a5ea9b (diff)
downloadvyos-cloud-init-49d3df468a94fef41a036dfa5d886449d180e006.tar.gz
vyos-cloud-init-49d3df468a94fef41a036dfa5d886449d180e006.zip
functional state now in kvm tests
supports user data as mime-multipart and handling types of text/x-shellscript - execute at rc.local text/cloud-config - feed to cloud config text/upstart-job - add to /etc/init as upstart job text/x-include-url - include urls as if they were in-line
Diffstat (limited to 'ec2-init.py')
-rwxr-xr-xec2-init.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/ec2-init.py b/ec2-init.py
index 90da7dc6..464bf568 100755
--- a/ec2-init.py
+++ b/ec2-init.py
@@ -6,6 +6,9 @@ import sys
import ec2init
+def warn(str):
+ sys.stderr.write(str)
+
def main():
cloud = ec2init.EC2Init()
@@ -17,13 +20,18 @@ def main():
sys.stderr.write("Failed to get instance data")
sys.exit(1)
- print "user data is:" + cloud.get_user_data()
+ #print "user data is:" + cloud.get_user_data()
# store the metadata
cloud.update_cache()
# parse the user data (ec2-run-userdata.py)
- # TODO: cloud.consume_user_data()
+ try:
+ cloud.sem_and_run("consume_userdata", "once-per-instance",
+ cloud.consume_userdata,[],False)
+ except:
+ warn("consuming user data failed!")
+ raise
# set the defaults (like what ec2-set-defaults.py did)
# TODO: cloud.set_defaults()