summaryrefslogtreecommitdiff
path: root/cloudinit/user_data.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-08-27 10:56:47 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-08-27 10:56:47 -0700
commit92b99b325b2d437825cc87253e76c756a136ff28 (patch)
tree57a0e234258c31d478e557a74ffff2b7095108e3 /cloudinit/user_data.py
parent33cfadd8f35b3f4beb77f871b4173600e42bbe49 (diff)
downloadvyos-cloud-init-92b99b325b2d437825cc87253e76c756a136ff28.tar.gz
vyos-cloud-init-92b99b325b2d437825cc87253e76c756a136ff28.zip
Update so that the content types searched for launch-index
variable has a little more meaning and by default look in metadata for 'launch-index' and have ec2 instead look for a different variable (thus allowing more datasources to just work).
Diffstat (limited to 'cloudinit/user_data.py')
-rw-r--r--cloudinit/user_data.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py
index 2b76482a..5d550e1d 100644
--- a/cloudinit/user_data.py
+++ b/cloudinit/user_data.py
@@ -53,7 +53,8 @@ ARCHIVE_UNDEF_TYPE = "text/cloud-config"
ATTACHMENT_FIELD = 'Number-Attachments'
# Only the following content types can have there launch index examined
-CAN_HAVE_LAUNCH_INDEX = ["text/cloud-config", "text/cloud-config-archive"]
+# in there payload, evey other content type can still provide a header
+EXAMINE_FOR_LAUNCH_INDEX = ["text/cloud-config", "text/cloud-config-archive"]
class UserDataProcessor(object):
@@ -101,7 +102,7 @@ class UserDataProcessor(object):
def _attach_launch_index(self, msg):
header_idx = msg.get('Launch-Index', None)
payload_idx = None
- if msg.get_content_type() in CAN_HAVE_LAUNCH_INDEX:
+ if msg.get_content_type() in EXAMINE_FOR_LAUNCH_INDEX:
try:
# See if it has a launch-index field
# that might affect the final header