hi, I am testing 0.7.0 on Scientific Linux CERN 6 (clone of RHEL6), with python-boto-2.5.2-1.el6.noarch. I build the rpm for cloud-init from trunk, revno 725. My isntances live in Openstack Essex. Python is 2.6.6.
My .ssh/authorized_keys are still not populated.
I debugged through sources/__init__.py, function normalize_pubkey_data(pubkey_data). So following text regards the function.
When I print the type of pubkey_data, it's <class 'boto.utils.LazyLoadMetadata'>. When I print the pubkey_data itself, the object gets evaluated and .ssh/authorized_keys are populated properly. In that case the pubkey_data are a dict:
Even if I don't print the pubkey_data, it takes the last branch ("if isinstance(pubkey_data, (dict)):"). However in the loop over iteritems of the dict, I get ('tkarasek_keypair', None), i.e. the value of pubkey_data['tkarasek_keypair'] is reported as None. Because of that, empty list is returned from normalize_pubkey_data.
When I change the loop to
for (_keyname, klist) in pubkey_data.items(): # isntead of for (_keyname, klist) in pubkey_data.iteritems()
I get the proper list in klist and my authorized keys are populated. It seems the iterator doesnt work well with the boto lazy metadata.
Would you change the loop from iteritems to items?
hi, I am testing 0.7.0 on Scientific Linux CERN 6 (clone of RHEL6), with python- boto-2. 5.2-1.el6. noarch. I build the rpm for cloud-init from trunk, revno 725. My isntances live in Openstack Essex. Python is 2.6.6.
My .ssh/authorized _keys are still not populated.
I debugged through sources/ __init_ _.py, function normalize_ pubkey_ data(pubkey_ data). So following text regards the function. LazyLoadMetadat a'>. When I print the pubkey_data itself, the object gets evaluated and .ssh/authorized _keys are populated properly. In that case the pubkey_data are a dict:
When I print the type of pubkey_data, it's <class 'boto.utils.
{'tkarasek_ keypair' : ['ssh-rsa AAAAB3NzaD1yc2E AAAABIwAAAIEAut juZ/3b+ eY3VvKWJPsgkfJq cjKaobgjJRbr/ jCwskGUNc8nGdB3 dhOJTFTUi/ gycrT8CeebB/ wwwM4oz3ip/ GJjCPaHS8X4vkqW sqgBQZ36cNzfRnq wKWRTMzAI19ekTI sOdjENyeQ+ QJoyOFIU9RJAOoe pEp/uMD3PH39FLf k= sth@lhost, '']}
Even if I don't print the pubkey_data, it takes the last branch ("if isinstance( pubkey_ data, (dict)):"). However in the loop over iteritems of the dict, I get ('tkarasek_ keypair' , None), i.e. the value of pubkey_ data['tkarasek_ keypair' ] is reported as None. Because of that, empty list is returned from normalize_ pubkey_ data.
When I change the loop to data.items( ): # isntead of for (_keyname, klist) in pubkey_ data.iteritems( )
for (_keyname, klist) in pubkey_
I get the proper list in klist and my authorized keys are populated. It seems the iterator doesnt work well with the boto lazy metadata.
Would you change the loop from iteritems to items?