From fdef6a9f84c5720bbd37f3eb98c9b7c58913bbfd Mon Sep 17 00:00:00 2001 From: Neal Shrader Date: Fri, 17 Oct 2014 16:26:46 -0400 Subject: Correct handling of single/multiple ssh keys --- cloudinit/sources/DataSourceDigitalOcean.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cloudinit') diff --git a/cloudinit/sources/DataSourceDigitalOcean.py b/cloudinit/sources/DataSourceDigitalOcean.py index b7afca93..c59232ca 100644 --- a/cloudinit/sources/DataSourceDigitalOcean.py +++ b/cloudinit/sources/DataSourceDigitalOcean.py @@ -19,6 +19,7 @@ from cloudinit import util from cloudinit import sources from cloudinit import url_helper from cloudinit import ec2_utils +from types import * import functools @@ -71,7 +72,10 @@ class DataSourceDigitalOcean(sources.DataSource): return "\n".join(self.metadata['vendor-data']) def get_public_ssh_keys(self): - return self.metadata['public-keys'].splitlines() + if type(self.metadata['public-keys']) is StringType: + return [self.metadata['public-keys']] + else: + return self.metadata['public-keys'] @property def availability_zone(self): -- cgit v1.2.3