~oddbloke/cloud-init/fix-gce-az

« back to all changes in this revision

Viewing changes to cloudinit/sources/DataSourceGCE.py

  • Committer: Daniel Watkins
  • Date: 2015-07-06 14:33:33 UTC
  • mto: This revision was merged to the branch mainline in revision 1121.
  • Revision ID: daniel.watkins@canonical.com-20150706143333-21g6bnmu62b65jcn
Return a sensible value for DataSourceGCE.availability_zone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
            lines = self.metadata['public-keys'].splitlines()
117
117
            self.metadata['public-keys'] = [self._trim_key(k) for k in lines]
118
118
 
 
119
        if self.metadata['availability-zone']:
 
120
            self.metadata['availability-zone'] = self.metadata[
 
121
                'availability-zone'].split('/')[-1]
 
122
 
119
123
        encoding = self.metadata.get('user-data-encoding')
120
124
        if encoding:
121
125
            if encoding == 'base64':