diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-08-31 15:44:50 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-08-31 15:44:50 -0400 |
commit | 27118e7406237510ca56e969aa1b6d9152c8afbf (patch) | |
tree | 781517557785592eb8dbe40fd52a0752af774ced /cloudinit/cloud.py | |
parent | c6e4c646287e26d15b8d2402527e1f77e21113cd (diff) | |
parent | ff60020fa3d8e457cf9d1d543af9193376bf598c (diff) | |
download | vyos-cloud-init-27118e7406237510ca56e969aa1b6d9152c8afbf.tar.gz vyos-cloud-init-27118e7406237510ca56e969aa1b6d9152c8afbf.zip |
support launch index specific user-data
EC2 and openstack provide 'launch_index' in their metadata. This allows
the user to specify cloud-config or multipart mime data that includes the
'Launch-Index' header.
If launch index is available in the metadata service, then:
* any part that contains a launch index other than the current launch-index
of this instance will be ignored.
* any part that does not contain a launch index will be considered as
for this instance.
If there is no such header, or launch_index is not available in the metadata
service, then no such filtering will be done.
LP: #1023177
Diffstat (limited to 'cloudinit/cloud.py')
-rw-r--r-- | cloudinit/cloud.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/cloud.py b/cloudinit/cloud.py index 620b3c07..95e0cfb2 100644 --- a/cloudinit/cloud.py +++ b/cloudinit/cloud.py @@ -70,12 +70,16 @@ class Cloud(object): return fn # The rest of thes are just useful proxies - def get_userdata(self): - return self.datasource.get_userdata() + def get_userdata(self, apply_filter=True): + return self.datasource.get_userdata(apply_filter) def get_instance_id(self): return self.datasource.get_instance_id() + @property + def launch_index(self): + return self.datasource.launch_index + def get_public_ssh_keys(self): return self.datasource.get_public_ssh_keys() |