From a50943ca264a3efafa2da8e4539744478da1e590 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 9 Sep 2011 13:57:15 -0700 Subject: accept that public-keys keys in the metadata service might be a string LP: #845155 --- cloudinit/DataSource.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloudinit/DataSource.py b/cloudinit/DataSource.py index 3f851e14..8e4b47e6 100644 --- a/cloudinit/DataSource.py +++ b/cloudinit/DataSource.py @@ -65,6 +65,10 @@ class DataSource: def get_public_ssh_keys(self): keys = [] if not self.metadata.has_key('public-keys'): return([]) + + if isinstance(self.metadata['public-keys'], str): + return(self.metadata['public-keys']) + for keyname, klist in self.metadata['public-keys'].items(): # lp:506332 uec metadata service responds with # data that makes boto populate a string for 'klist' rather -- cgit v1.2.3