cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #05525
Re: [Merge] ~chad.smith/cloud-init:feature/cli-cloudinit-query into cloud-init:master
Diff comments:
> diff --git a/cloudinit/sources/__init__.py b/cloudinit/sources/__init__.py
> index a775f1a..94d919d 100644
> --- a/cloudinit/sources/__init__.py
> +++ b/cloudinit/sources/__init__.py
> @@ -152,12 +184,22 @@ class DataSource(object):
>
> def _get_standardized_metadata(self):
> """Return a dictionary of standardized metadata keys."""
> - return {'v1': {
> - 'local-hostname': self.get_hostname(),
> - 'instance-id': self.get_instance_id(),
> - 'cloud-name': self.cloud_name,
> - 'region': self.region,
> - 'availability-zone': self.availability_zone}}
> + local_hostname = self.get_hostname()
> + instance_id = self.get_instance_id()
> + availability_zone = self.availability_zone
> + # When adding new standard keys prefer underscore-delimited instead
> + # of hyphen-delimted to support simple variable references in jinja
> + # templates.
> + return {
> + 'v1': {
> + 'availability-zone': availability_zone,
> + 'availability_zone': availability_zone,
> + 'cloud-name': self.cloud_name,
I had left it out intentionally because I felt like our followup discussion about platform_name vs cloud_name may lead us into dropping this key altogether. But, let's just put it in for the moment. and we can back it out in the followup instance-data standardization branch.
> + 'instance-id': instance_id,
> + 'instance_id': instance_id,
> + 'local-hostname': local_hostname,
> + 'local_hostname': local_hostname,
> + 'region': self.region}}
>
> def clear_cached_attrs(self, attr_defaults=()):
> """Reset any cached metadata attributes to datasource defaults.
--
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/354891
Your team cloud-init commiters is requested to review the proposed merge of ~chad.smith/cloud-init:feature/cli-cloudinit-query into cloud-init:master.