Code Monkey home page Code Monkey logo

oscurl's People

Contributors

amotoki avatar yosshy avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

amotoki

oscurl's Issues

URL constructing is broken after changed to use urljoin

When compute endpoint is http://172.27.201.206:8774/v2.1 and servers is specified in -p option, the requested URL is expected to be http://172.27.201.206:8774/v2.1 /servers but actually http://172.27.201.206:8774/servers is sent. urlparse.urljoin drops /v2.1 part.

ubuntu@sheep6:~/tmp/oscurl (master) [OS:demo/[email protected]][13:45:18]$ openstack catalog show compute
+-----------+-------------------------------------------+
| Field     | Value                                     |
+-----------+-------------------------------------------+
| endpoints | RegionOne                                 |
|           |   public: http://172.27.201.206:8774/v2.1 |
|           |                                           |
| id        | ab70cb9473b946aaa60970cac0dc6713          |
| name      | nova                                      |
| type      | compute                                   |
+-----------+-------------------------------------------+
ubuntu@sheep6:~/tmp/oscurl (master) [OS:demo/[email protected]][13:45:27]$ oscurl --version
0.4.0
ubuntu@sheep6:~/tmp/oscurl (master) [OS:demo/[email protected]][13:45:37]$ oscurl --debug -p /servers
DEBUG:keystoneauth.session:REQ: curl -g -i -X GET http://172.27.201.206:8774/servers -H "User-Agent: oscurl keystoneauth1/2.18.0 python-requests/2.12.5 CPython/2.7.12" -H "X-Auth-Token: {SHA1}fb1f77ba6d1ca4018adf63f056b9e74fd308f058"
DEBUG:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 172.27.201.206
DEBUG:requests.packages.urllib3.connectionpool:http://172.27.201.206:8774 "GET /servers HTTP/1.1" 300 461
DEBUG:keystoneauth.session:RESP: [300] Content-Length: 461 Content-Type: application/json Date: Mon, 20 Mar 2017 13:45:53 GMT Connection: keep-alive 
RESP BODY: {"choices": [{"status": "SUPPORTED", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2"}], "id": "v2.0", "links": [{"href": "http://172.27.201.206:8774/v2/servers", "rel": "self"}]}, {"status": "CURRENT", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2.1"}], "id": "v2.1", "links": [{"href": "http://172.27.201.206:8774/v2.1/servers", "rel": "self"}]}]}

HTTP/1.1 300 Multiple Choices
Content-Length: 461
Content-Type: application/json
Date: Mon, 20 Mar 2017 13:45:53 GMT
Connection: keep-alive

{"choices": [{"status": "SUPPORTED", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2"}], "id": "v2.0", "links": [{"href": "http://172.27.201.206:8774/v2/servers", "rel": "self"}]}, {"status": "CURRENT", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2.1"}], "id": "v2.1", "links": [{"href": "http://172.27.201.206:8774/v2.1/servers", "rel": "self"}]}]}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.