From 1f107c05948a34cfe53dc26b2dcb863ee4a0f304 Mon Sep 17 00:00:00 2001 From: Ben Howard Date: Thu, 3 Oct 2013 16:41:32 -0600 Subject: Configure SmartOS Datasource to be region aware --- cloudinit/sources/DataSourceSmartOS.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.3