You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by "Dave King (Created) (JIRA)" <ji...@apache.org> on 2012/02/16 18:33:00 UTC

[dev] [jira] [Created] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

OpenStack BaseConnection does not allow GET parameters as a key-value pairing
-----------------------------------------------------------------------------

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


For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.

This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Updated] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Dave King (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave King updated LIBCLOUD-153:
-------------------------------

    Attachment: libcloud-153.patch

First attempt at this.
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Tomaz Muraus (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209609#comment-13209609 ] 

Tomaz Muraus commented on LIBCLOUD-153:
---------------------------------------

I would make the docstring look like this:

@type params: C{dict} or C{list} of C{tuple}
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Tomaz Muraus (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209587#comment-13209587 ] 

Tomaz Muraus commented on LIBCLOUD-153:
---------------------------------------

I would be OK with only supporting this in the OpenStack driver for now, but I would also like to fix it inside the base connection class and other drivers ASAP.

Also keep in mind that there are many hooks and places where the request parameters are modified (add_default_params, etc.) which means we need to be careful when modifying existing code and add a bunch of tests so we can be sure that we didn't break something.
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Dave King (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209603#comment-13209603 ] 

Dave King commented on LIBCLOUD-153:
------------------------------------

Oh, what is the pattern for getting the pydoc correct here?  params is no longer a dict but I'm not clear how to update the pydoc to show it can be a dict or a tuple list.
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Dave King (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209571#comment-13209571 ] 

Dave King commented on LIBCLOUD-153:
------------------------------------

I've attached a file with my first attempt at this.

I think that libcloud not supporting params as a tuple list makes the utility of the connection objects much lower.

I think long term we would want to get away from params-as-a-dict.  I'm not sure if it's better to just allow the OpenStackBaseConnection to have this special behavior for now or allow users to pass parameters in as a dict of lists (but that breaks a lot of things too).

Let me know what you think.
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Dave King (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209598#comment-13209598 ] 

Dave King commented on LIBCLOUD-153:
------------------------------------

Cool.  I'll open another JIRA for that.

I think the right pattern for a general fix is to make a _extend_parameters in the Connection superclass that does the right thing if you pass in a dict or a list.  That should alleviate most of the danger in making this change, unless there's something I'm missing.
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Resolved] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Tomaz Muraus (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomaz Muraus resolved LIBCLOUD-153.
-----------------------------------

    Resolution: Fixed
    
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153-attempt-2.patch, libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Tomaz Muraus (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209606#comment-13209606 ] 

Tomaz Muraus commented on LIBCLOUD-153:
---------------------------------------

Sounds good to me.

Also please update your repository and attach a new patch, because this one doesn't apply cleanly to the current trunk (probably related to the Brad's latest changes).
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Updated] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Dave King (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave King updated LIBCLOUD-153:
-------------------------------

    Attachment: libcloud-153-attempt-2.patch
    
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153-attempt-2.patch, libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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

        

[dev] [jira] [Commented] (LIBCLOUD-153) OpenStack BaseConnection does not allow GET parameters as a key-value pairing

Posted by "Dave King (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LIBCLOUD-153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13209619#comment-13209619 ] 

Dave King commented on LIBCLOUD-153:
------------------------------------

I'll change the docstring on the base Connection class to that with LIBCLOUD-154, thanks.

Attached a patch of changes against the most recent trunk, sorry about that.
                
> OpenStack BaseConnection does not allow GET parameters as a key-value pairing
> -----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-153
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-153
>             Project: Libcloud
>          Issue Type: Bug
>          Components: Core
>            Reporter: Dave King
>            Priority: Minor
>         Attachments: libcloud-153-attempt-2.patch, libcloud-153.patch
>
>
> For GETs, OpenStack BaseConnection assigns the cache-busting attribute on the parameters to a random number.
> This assignment is done as a dictionary assignment, meaning it is not possible to pass in a value of key-value pairs (the main reason to do this is to pass the same key in with different values, for example, as in the batch delete at http://docs.rackspace.com/loadbalancers/api/v1.0/clb-devguide/content/Remove_Nodes-d1e2675.html

--
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