'Invalid literal' error occurs when a hostname in an endpoint has a version string

Bug #1489727 reported by Takashi Natsume
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Takashi Natsume

Bug Description

'Invalid literal' error occurs when an endpoint does not have a path string and
a hostname in an endpoint has a version string('v\d+\.?\d*').

For example, 'http://v1.test:9292/'.

[How to reproduce]
stack@devstack-kilo:/opt/devstack$ export OS_IMAGE_URL=http://localhost:9292/
stack@devstack-kilo:/opt/devstack$ glance image-list
+--------------------------------------+---------------------------------+
| ID | Name |
+--------------------------------------+---------------------------------+
| f543a518-ffca-4e7d-ac41-e64802e74ad5 | cirros-0.3.2-x86_64-uec |
| 9ea58a20-7c1c-4769-8007-ea1c5f000ea5 | cirros-0.3.2-x86_64-uec-kernel |
| 439c10b8-ed74-44df-9e85-8b3b62c2c7c7 | cirros-0.3.2-x86_64-uec-ramdisk |
+--------------------------------------+---------------------------------+
stack@devstack-kilo:/opt/devstack$ export OS_IMAGE_URL=http://v1.test:9292/
stack@devstack-kilo:/opt/devstack$ ping -c 5 v1.test
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.088 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.051 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.051 ms
64 bytes from localhost (127.0.0.1): icmp_seq=5 ttl=64 time=0.067 ms

--- localhost ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3999ms
rtt min/avg/max/mdev = 0.036/0.058/0.088/0.019 ms
stack@devstack-kilo:/opt/devstack$ glance image-list
WARNING: The client is falling back to v1 because the accessing to v2 failed. This behavior will be removed in future versions
invalid literal for float(): 1.test:9292

[Environment]
python-glanceclient: master(commit: 54ae632f1b6dfba18a16ba934cd8052fe766693f)
glance: stable/kilo(2015.1.0)
OS: Ubuntu 14.04 LTS

Changed in python-glanceclient:
assignee: nobody → Takashi NATSUME (natsume-takashi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/218126

Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/218126
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=19480df10a98165597d33eea360cbfe7460e3309
Submitter: Jenkins
Branch: master

commit 19480df10a98165597d33eea360cbfe7460e3309
Author: Takashi NATSUME <email address hidden>
Date: Fri Aug 28 16:16:06 2015 +0900

    Add parsing the endpoint URL

    Add parsing the endpoint URL and check the path string only
    in order to decide the API version.

    Change-Id: Ib0a035f3bed31e2162a1231a5f5dcc3907d37243
    Closes-Bug: #1489727

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
milestone: none → 1.2.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.