diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-08-27 10:56:47 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-08-27 10:56:47 -0700 |
commit | 92b99b325b2d437825cc87253e76c756a136ff28 (patch) | |
tree | 57a0e234258c31d478e557a74ffff2b7095108e3 /cloudinit/sources/DataSourceEc2.py | |
parent | 33cfadd8f35b3f4beb77f871b4173600e42bbe49 (diff) | |
download | vyos-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/sources/DataSourceEc2.py')
-rw-r--r-- | cloudinit/sources/DataSourceEc2.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py index 3e450e7e..2a9a70f7 100644 --- a/cloudinit/sources/DataSourceEc2.py +++ b/cloudinit/sources/DataSourceEc2.py @@ -77,7 +77,10 @@ class DataSourceEc2(sources.DataSource): self.metadata_address) return False - def get_launch_index(self): + @property + def launch_index(self): + if not self.metadata: + return None return self.metadata.get('ami-launch-index') def get_instance_id(self): |