~smoser/ubuntu/vivid/cloud-init/snappy

« back to all changes in this revision

Viewing changes to cloudinit/sources/__init__.py

  • Committer: Scott Moser
  • Date: 2015-02-27 20:55:58 UTC
  • mfrom: (355.2.8 vivid)
  • Revision ID: smoser@ubuntu.com-20150227205558-glrwdgxqkaz6zyxa
* Merge with vivid at 0.7.7~bzr1067-0ubuntu1
* New upstream snapshot.
  * fix broken consumption of gzipped user-data (LP: #1424900)
  * functional user-data on Azure again (LP: #1423972)
  * CloudStack: support fetching password from virtual router (LP: #1422388)
* New upstream snapshot.
  * Fix for ascii decode in DataSourceAzure (LP: #1422993).
* New upstream snapshot.
  * support for gpt partitioning, utilized in Azure [Daniel Watkins]
  * fix bug in exception handling in mount_cb.
* New upstream snapshot.
  * move to python3 (LP: #1247132)
  * systemd: run cloud-init before systemd-user-sessions.service
  * Use the GCE short hostname. (LP: #1383794)
  * Enable user-data encoding support for GCE. (LP: #1404311)
  * Update to use a newer and better OMNIBUS_URL
  * Be more tolerant of 'ssh_authorized_keys' types
  * Fix parse_ssh_config failing in ssh_util.py
  * Increase the robustness/configurability of the chef module.
  * retain trailing newline from template files when using
    jinja2 (LP: #1355343)
  * fix broken output handling (LP: #1387340)
  * digital ocean datasource
  * update url in config drive documentation
  * freebsd: enable correct behavior on Ec2.
  * freebsd: Use the proper virtio FreeBSD network interface name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import abc
24
24
import os
25
25
 
 
26
import six
 
27
 
26
28
from cloudinit import importer
27
29
from cloudinit import log as logging
28
30
from cloudinit import type_utils
130
132
        # we want to return the correct value for what will actually
131
133
        # exist in this instance
132
134
        mappings = {"sd": ("vd", "xvd", "vtb")}
133
 
        for (nfrom, tlist) in mappings.iteritems():
 
135
        for (nfrom, tlist) in mappings.items():
134
136
            if not short_name.startswith(nfrom):
135
137
                continue
136
138
            for nto in tlist:
218
220
    if not pubkey_data:
219
221
        return keys
220
222
 
221
 
    if isinstance(pubkey_data, (basestring, str)):
 
223
    if isinstance(pubkey_data, six.string_types):
222
224
        return str(pubkey_data).splitlines()
223
225
 
224
226
    if isinstance(pubkey_data, (list, set)):
225
227
        return list(pubkey_data)
226
228
 
227
229
    if isinstance(pubkey_data, (dict)):
228
 
        for (_keyname, klist) in pubkey_data.iteritems():
 
230
        for (_keyname, klist) in pubkey_data.items():
229
231
            # lp:506332 uec metadata service responds with
230
232
            # data that makes boto populate a string for 'klist' rather
231
233
            # than a list.
232
 
            if isinstance(klist, (str, basestring)):
 
234
            if isinstance(klist, six.string_types):
233
235
                klist = [klist]
234
236
            if isinstance(klist, (list, set)):
235
237
                for pkey in klist: