summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2015-07-20 15:33:25 +0100
committerDaniel Watkins <daniel.watkins@canonical.com>2015-07-20 15:33:25 +0100
commitf73991b9697d15e2d7d931e493125ca291025673 (patch)
tree287e8b3a4f8007f659cc2e86e6af9969136c518e /cloudinit
parent22186f7efb9437b3b4d0fcd82319e2392bc8b4ac (diff)
parentafb5421ee717174b989bfed61333f2073b3f3f50 (diff)
downloadvyos-cloud-init-f73991b9697d15e2d7d931e493125ca291025673.tar.gz
vyos-cloud-init-f73991b9697d15e2d7d931e493125ca291025673.zip
Return a sensible value for DataSourceGCE.availability_zone.
LP: #1470880
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':