From 86d8955a5ca3e374fcabe7f6b0f9ebfe47d47441 Mon Sep 17 00:00:00 2001 From: Scott Moser <smoser@nelson> Date: Tue, 12 Jan 2010 12:16:01 -0500 Subject: work around differences in uec and ec2 metadata services LP: #506332 --- ec2init/DataSourceEc2.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ec2init/DataSourceEc2.py b/ec2init/DataSourceEc2.py index 84f2f71c..9afbe8b9 100644 --- a/ec2init/DataSourceEc2.py +++ b/ec2init/DataSourceEc2.py @@ -97,6 +97,11 @@ class DataSourceEc2(DataSource.DataSource): keys = [] if not self.metadata.has_key('public-keys'): return([]) 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 + # than a list. + if isinstance(klist,str): + klist = [ klist ] for pkey in klist: # there is an empty string at the end of the keylist, trim it if pkey: -- cgit v1.2.3