[Bug 432773] Re: ec2-fetch-credentials do not work in jaunty instance being run on Eucalyptus

Etienne Goyer etienne.goyer at canonical.com
Fri Sep 18 22:24:50 UTC 2009


After investigation (thanks Marc!), it seems like Eucalyptus add a
trailing newline to the output of http://169.254.169.254/2008-02-01
/meta-data/public-keys/.  That confuse ec2-fetch-credentials; adding a
check for empty newline in get_ssh_keys() actually fix the bug, such as:

def get_ssh_keys():
    base_url = 'http://169.254.169.254/%s/meta-data' % api_ver
    data = urllib.urlopen('%s/public-keys/' % base_url).read()
    keyids = [line.split('=')[0] for line in data.split('\n') if line]    <-- *** That is where to check for empty line ***
    return [urllib.urlopen('%s/public-keys/%d/openssh-key' % (base_url, int(keyid))).read().rstrip() for keyid in keyids]

-- 
ec2-fetch-credentials do not work in jaunty instance being run on Eucalyptus
https://bugs.launchpad.net/bugs/432773
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list