[ 
https://issues.apache.org/jira/browse/LIBCLOUD-528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

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

    Description: 
Using NodeAuthSSHKey with EC2 fails:

{code}
auth = NodeAuthSSHKey("ssh-rsa .... [email protected]")
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}

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.  

  was:
Using NodeAuthSSHKey with EC2 fails:

{code}
auth = NodeAuthSSHKey("ssh-rsa .... [email protected]")
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.  


> 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 .... [email protected]")
> 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}
> 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)

Reply via email to