summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2015-07-06 15:33:33 +0100
committerDaniel Watkins <daniel.watkins@canonical.com>2015-07-06 15:33:33 +0100
commitafb5421ee717174b989bfed61333f2073b3f3f50 (patch)
treea3af684ab26c038ce9cb2cb758aafa873072d7f1 /cloudinit
parent33e1f251aa2ff75475fe0f02f1e344dbe949d89d (diff)
downloadvyos-cloud-init-afb5421ee717174b989bfed61333f2073b3f3f50.tar.gz
vyos-cloud-init-afb5421ee717174b989bfed61333f2073b3f3f50.zip
Return a sensible value for DataSourceGCE.availability_zone.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceGCE.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceGCE.py b/cloudinit/sources/DataSourceGCE.py
index f4ed915d..1b28a68c 100644
--- a/cloudinit/sources/DataSourceGCE.py
+++ b/cloudinit/sources/DataSourceGCE.py
@@ -116,6 +116,10 @@ class DataSourceGCE(sources.DataSource):
lines = self.metadata['public-keys'].splitlines()
self.metadata['public-keys'] = [self._trim_key(k) for k in lines]
+ if self.metadata['availability-zone']:
+ self.metadata['availability-zone'] = self.metadata[
+ 'availability-zone'].split('/')[-1]
+
encoding = self.metadata.get('user-data-encoding')
if encoding:
if encoding == 'base64':