summaryrefslogtreecommitdiff
path: root/cloudinit/DataSourceEc2.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-06-18 00:23:25 -0400
committerScott Moser <smoser@ubuntu.com>2010-06-18 00:23:25 -0400
commit17fabe47dcbbe6b2180e73cac6211f7394d61a8a (patch)
tree9601bf8d16d19584f1a03749cb1e69965ab23148 /cloudinit/DataSourceEc2.py
parent6cdd4bf0a05d90e1e5b9c7b9b3c9f5c251c0a652 (diff)
downloadvyos-cloud-init-17fabe47dcbbe6b2180e73cac6211f7394d61a8a.tar.gz
vyos-cloud-init-17fabe47dcbbe6b2180e73cac6211f7394d61a8a.zip
add 'cloud-boothook' type
if user data is of type text/cloud-boothook, or begins with #cloud-boothook, then assume it to be code to be executed. Boothooks are a very simple format. Basically, its a one line header ('#cloud-config\n') and then executable payload. The executable payload is written to a file, then that file is executed at the time it is read. The file is left in /var/lib/cloud/data/boothooks There is no "first-time-only" protection. If running only once is desired, the boothook must handle that itself.
Diffstat (limited to 'cloudinit/DataSourceEc2.py')
-rw-r--r--cloudinit/DataSourceEc2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/DataSourceEc2.py b/cloudinit/DataSourceEc2.py
index ebee61c6..1094b8a6 100644
--- a/cloudinit/DataSourceEc2.py
+++ b/cloudinit/DataSourceEc2.py
@@ -40,6 +40,7 @@ class DataSourceEc2(DataSource.DataSource):
def get_data(self):
try:
+ cloudinit.log.info("looking at %s/user-data.raw" % self.cachedir)
udf = open(self.cachedir + "/user-data.raw")
self.userdata_raw = udf.read()
udf.close()
@@ -132,7 +133,7 @@ class DataSourceEc2(DataSource.DataSource):
(time.strftime("%H:%M:%S"), x+1, sleeps, reason))
time.sleep(sleeptime)
- log.critical("giving up on md after %i seconds\n" %
+ cloudinit.log.critical("giving up on md after %i seconds\n" %
int(time.time()-starttime))
return False