You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Stefan Müller (JIRA)" <ji...@apache.org> on 2014/03/11 17:25:44 UTC

[jira] [Created] (LIBCLOUD-528) Using NodeAuthSSHKey on EC2 fails

Stefan Müller created LIBCLOUD-528:
--------------------------------------

             Summary: Using NodeAuthSSHKey on EC2 fails
                 Key: LIBCLOUD-528
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-528
             Project: Libcloud
          Issue Type: Bug
          Components: Compute
         Environment: Windows 7, apache-libcloud 0.14.1
            Reporter: Stefan Müller


Using NodeAuthSSHKey with EC2 fails:

{code}
auth = NodeAuthSSHKey("ssh-rsa .... foo@bar.com")
driver.create_node(...., auth=auth)
{code}

This produces an error message:

{code}
SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details
{code}

The same code with the {{auth=auth}} argument removed works.

I've investigated a bit and found a possible cause in {{compute/drivers/ec2.py}} (around line 1358):

{code}
       if 'auth' in kwargs:
            auth = self._get_and_check_auth(kwargs['auth'])
            params['KeyName'] = \
                self.ex_find_or_import_keypair_by_key_material(auth.pubkey)
{code}

But the {{ex_find_or_import_keypair_by_key_material}} returns a {{dict}}, yet {{params['KeyName']}} should be a string.

If I change it to

{code}
        if 'auth' in kwargs:
            auth = self._get_and_check_auth(kwargs['auth'])
            params['KeyName'] = \
                self.ex_find_or_import_keypair_by_key_material(auth.pubkey)['keyName']
{code}

Then it works fine.  



--
This message was sent by Atlassian JIRA
(v6.2#6252)