You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by phillipkent <gi...@git.apache.org> on 2015/12/19 16:49:32 UTC

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

GitHub user phillipkent opened a pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11

    Update requester.py

    urllib.quote_plus() requires the option safe="*" (that is, the * character is not encoded) to be consistent with CloudStack's internal encoder/decoder. Without this, API calls containing the * character will fail API authentication.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/phillipkent/cloudstack-cloudmonkey fix_urllib_quote_plus

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #11
    
----
commit 46b84a6ef713f939ce03b5e613d133ddbc70338f
Author: Phillip Kent <ph...@xmlsoup.com>
Date:   2015-12-19T15:47:56Z

    Update requester.py
    
    urllib.quote_plus() requires the option safe="*" (that is, the * character is not encoded) to be consistent with CloudStack's internal encoder/decoder. Without this, API calls containing the * character will fail API authentication.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by phillipkent <gi...@git.apache.org>.
Github user phillipkent commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-171242939
  
    @bhaisaab I tested a clean virtualenv install of Cloudmonkey 5.3.2 (from PyPy) and also a clone of the latest Cloudmonkey from github (Python version is 2.7.6). Both of those give me authentication failure when passing a '*' in the command string. The endpoint I am testing is CloudPlatform 4.3.2 (with customisations). Can it be an issue for v4.3.2 but not in later version? I will investigate further and try to diagnose.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-170056433
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-170059404
  
    @phillipkent can you share examples of API/cloudmonkey commands where we would like to use * in the args?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-170516429
  
    @phillipkent I understand, but looks like it still works without your fix. I was able to update network display test with a * in it:
    
    Update API:
    
    2016-01-11 17:10:09,300 - requester.py:49 - [DEBUG] ======== START Request ========                                                                                                            
    2016-01-11 17:10:09,300 - requester.py:49 - [DEBUG] Requesting command=updateNetwork, args={u'displaytext': u'test*', u'id': u'7c0453ad-1689-423a-a90f-ce69a317694b'}
    2016-01-11 17:10:09,301 - connectionpool.py:203 - [INFO] Starting new HTTP connection (1): localhost
    2016-01-11 17:10:09,375 - connectionpool.py:383 - [DEBUG] "GET /client/api?signatureversion=3&apiKey=&expires=2016-01-11T11%3A50%3A09%2B0000&id=7c0453ad-1689-423a-a90f-ce69a317694b&command=updateNetwork&signature=MVIus5218oqK8bL46AyPRyR%2FDBI%3D&displaytext=test%2A&response=json HTTP/1.1" 200 None
    2016-01-11 17:10:09,375 - requester.py:49 - [DEBUG] Request sent: http://localhost:8096/client/api?signatureversion=3&apiKey=&expires=2016-01-11T11%3A50%3A09%2B0000&id=7c0453ad-1689-423a-a90f-ce69a317694b&command=updateNetwork&signature=MVIus5218oqK8bL46AyPRyR%2FDBI%3D&displaytext=test%2A&response=json
    2016-01-11 17:10:09,375 - requester.py:49 - [DEBUG] Response received: {"updatenetworkresponse":{"jobid":"879eac5b-94d5-474a-8e5e-840fd9e5652e"}}
    2016-01-11 17:10:09,375 - requester.py:49 - [DEBUG] ======== END Request ========  
    
    List API to verify:
    
    2016-01-11 17:10:24,671 - requester.py:49 - [DEBUG] ======== START Request ========
    2016-01-11 17:10:24,671 - requester.py:49 - [DEBUG] Requesting command=listNetworks, args={}
    2016-01-11 17:10:24,673 - connectionpool.py:203 - [INFO] Starting new HTTP connection (1): localhost
    2016-01-11 17:10:24,693 - connectionpool.py:383 - [DEBUG] "GET /client/api?signatureversion=3&apiKey=&expires=2016-01-11T11%3A50%3A24%2B0000&command=listNetworks&signature=2JxFqItleF3j9ehZqXnLQXYgK6g%3D&response=json HTTP/1.1" 200 None
    2016-01-11 17:10:24,693 - requester.py:49 - [DEBUG] Request sent: http://localhost:8096/client/api?signatureversion=3&apiKey=&expires=2016-01-11T11%3A50%3A24%2B0000&command=listNetworks&signature=2JxFqItleF3j9ehZqXnLQXYgK6g%3D&response=json
    2016-01-11 17:10:24,693 - requester.py:49 - [DEBUG] Response received: {"listnetworksresponse":{"count":1,"network":[{"id":"7c0453ad-1689-423a-a90f-ce69a317694b","name":"guestNetworkForBasicZone","displaytext":"test*","broadcastdomaintype":"Native","traffictype":"Guest","zoneid":"e8c8546d-27bb-40f2-9a57-e37571449bf9","zonename":"MyBasicZone","networkofferingid":"4d7d1343-18ce-466e-8d92-209d96efdcdf","networkofferingname":"DefaultSharedNetworkOffering","networkofferingdisplaytext":"Offering for Shared networks","networkofferingconservemode":true,"networkofferingavailability":"Optional","issystem":false,"state":"Setup","related":"7c0453ad-1689-423a-a90f-ce69a317694b","broadcasturi":"vlan://untagged","dns1":"8.8.8.8","type":"Shared","vlan":"untagged","acltype":"Domain","subdomainaccess":true,"domainid":"f8133339-ad2c-11e5-be84-00012e4ff7d0","domain":"ROOT","service":[{"name":"Dhcp","capability":[{"name":"DhcpAccrossMultipleSubnets","value":"true","canchooseservicecapability":false}]
 },{"name":"Dns","capability":[{"name":"AllowDnsSuffixModification","value":"true","canchooseservicecapability":false}]},{"name":"UserData"}],"networkdomain":"cs1cloud.internal","physicalnetworkid":"19ded38f-460a-4344-a60f-df788954ba11","restartrequired":false,"specifyipranges":true,"canusefordeploy":true,"ispersistent":false,"tags":[],"displaynetwork":true,"strechedl2subnet":false}]}}
    2016-01-11 17:10:24,694 - requester.py:49 - [DEBUG] ======== END Request ========  



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-206823599
  
    @phillipkent I hit this issue today, while passing an argument. this worked for me.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by bhaisaab <gi...@git.apache.org>.
Github user bhaisaab commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-171620358
  
    I've tried the update network API with ACS 4.5.2 and 4.7.0 and it works for me, so it could be a 4.3.2 related limitation. In that case, we can have this fix though in the request/response logged it made no difference with/without this fix irrespective of the ACS version (as logged in previous comments).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by phillipkent <gi...@git.apache.org>.
Github user phillipkent commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-170278540
  
    @bhaisaab The commands that I tested were to set or modify the displaytext/displayname for a network or virtual machine,  such as " update network id=xxxxx displaytext='*test* " . I need to try your example and check that I understand what is going on. I do accept that * is not a very likely symbol to use, however it should work with breaking anything.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cloudstack-cloudmonkey pull request: Update requester.py

Posted by phillipkent <gi...@git.apache.org>.
Github user phillipkent commented on the pull request:

    https://github.com/apache/cloudstack-cloudmonkey/pull/11#issuecomment-206907782
  
    @bhaisaab : Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---