Parameters For All Drivers and Base Connection Do Not Support Tuple Lists
-------------------------------------------------------------------------

                 Key: LIBCLOUD-154
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-154
             Project: Libcloud
          Issue Type: Task
          Components: Core
            Reporter: Dave King
            Priority: Minor


Currently the parameters argument to the base connection's request method is 
required to be a dict.

This prevents passing multiple query-string arguments with the same key.

The code sometimes works 'as is' because urlencode supports either dicts/tuple 
lists, but throughout the libcloud codebase there is code like:

EC2Connection:

    def add_default_params(self, params):
        params['SignatureVersion'] = '2'
        params['SignatureMethod'] = 'HmacSHA256'
        params['AWSAccessKeyId'] = self.user_id
        params['Version'] = API_VERSION
        params['Timestamp'] = time.strftime('%Y-%m-%dT%H:%M:%SZ',
                                            time.gmtime())
        params['Signature'] = self._get_aws_auth_param(params, self.key,
                                                       self.action)
        return params

This prevents tuple lists being used for EC2 drivers, for example.

A solution here would be to add a _extend_parameters to the base connection 
object, make it work whether the parameters were a dict or a list, and then 
update all the parameter mutating parts of the codebase to use it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to