diff options
author | Barry Warsaw <barry@python.org> | 2015-01-21 17:56:53 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2015-01-21 17:56:53 -0500 |
commit | f895cb12141281702b34da18f2384deb64c881e7 (patch) | |
tree | 7a7433752ba1317c370dd3dd815c9ee7331a923b /cloudinit/sources/DataSourceDigitalOcean.py | |
parent | a64bb4febc79fcf641f6471d8cc00c74ca915f3d (diff) | |
download | vyos-cloud-init-f895cb12141281702b34da18f2384deb64c881e7.tar.gz vyos-cloud-init-f895cb12141281702b34da18f2384deb64c881e7.zip |
Largely merge lp:~harlowja/cloud-init/py2-3 albeit manually because it seemed
to be behind trunk.
`tox -e py27` passes full test suite. Now to work on replacing mocker.
Diffstat (limited to 'cloudinit/sources/DataSourceDigitalOcean.py')
-rw-r--r-- | cloudinit/sources/DataSourceDigitalOcean.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/cloudinit/sources/DataSourceDigitalOcean.py b/cloudinit/sources/DataSourceDigitalOcean.py index 8f27ee89..b20ce2a1 100644 --- a/cloudinit/sources/DataSourceDigitalOcean.py +++ b/cloudinit/sources/DataSourceDigitalOcean.py @@ -18,7 +18,7 @@ from cloudinit import log as logging from cloudinit import util from cloudinit import sources from cloudinit import ec2_utils -from types import StringType + import functools @@ -72,10 +72,11 @@ class DataSourceDigitalOcean(sources.DataSource): return "\n".join(self.metadata['vendor-data']) def get_public_ssh_keys(self): - if type(self.metadata['public-keys']) is StringType: - return [self.metadata['public-keys']] + public_keys = self.metadata['public-keys'] + if isinstance(public_keys, list): + return public_keys else: - return self.metadata['public-keys'] + return [public_keys] @property def availability_zone(self): |