diff options
author | Ben Howard <ben.howard@canonical.com> | 2013-10-03 16:41:32 -0600 |
---|---|---|
committer | Ben Howard <ben.howard@canonical.com> | 2013-10-03 16:41:32 -0600 |
commit | 1f107c05948a34cfe53dc26b2dcb863ee4a0f304 (patch) | |
tree | 256910bc2ec90ea837353fc16e2369e8557742c8 /cloudinit/sources/DataSourceSmartOS.py | |
parent | ecf2a600e41a9632ad305eb6a8cd5665908f31fb (diff) | |
download | vyos-cloud-init-1f107c05948a34cfe53dc26b2dcb863ee4a0f304.tar.gz vyos-cloud-init-1f107c05948a34cfe53dc26b2dcb863ee4a0f304.zip |
Configure SmartOS Datasource to be region aware
Diffstat (limited to 'cloudinit/sources/DataSourceSmartOS.py')
-rw-r--r-- | cloudinit/sources/DataSourceSmartOS.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceSmartOS.py b/cloudinit/sources/DataSourceSmartOS.py index 666129ec..2813ffb3 100644 --- a/cloudinit/sources/DataSourceSmartOS.py +++ b/cloudinit/sources/DataSourceSmartOS.py @@ -46,6 +46,7 @@ SMARTOS_ATTRIB_MAP = { 'user-data': ('user-data', False), 'iptables_disable': ('iptables_disable', True), 'motd_sys_info': ('motd_sys_info', True), + 'availability_zone': ('region', True), } DS_NAME = 'SmartOS' @@ -175,6 +176,13 @@ class DataSourceSmartOS(sources.DataSource): seed_timeout=self.seed_timeout, default=default, b64=b64) + @property + def availability_zone(self): + try: + return self.metadata['availability-zone'] + except KeyError: + return None + def get_serial(seed_device, seed_timeout): """This is replaced in unit testing, allowing us to replace |