~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-20 14:33:25 UTC
  • mfrom: (1118.2.2 fix-gce-az)
  • Revision ID: daniel.watkins@canonical.com-20150720143325-566rbxalnspf33vt
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':