image_v2 (openstackclient/api/image_v2.py) seems to still be using _munge_url instead of version discovery which is looking for the 'v2' string in the url,. Fairly certain this is a known weakness, but it's a problem for people with v2 in their domain names and I'm sure folks would appreciate not having to work around
Partial response from openstack image list --debug below, I've replaced our url with (domain name with v2 in the string):
REQ: curl -g -i -X GET http://(domain name with v2 in the string):9292/images -H "User-Agent: python-openstackclient keystoneauth1/2.4.1 python-requests/2.13.0 CPython/2.7.6" -H "X-Auth-Token: {SHA1}1cef10729c12600a6695c5abe593b8ec0848af99"
Starting new HTTP connection (1): (domain name with v2 in the string)
http://(domain name with v2 in the string):9292 "GET /images HTTP/1.1" 300 792
RESP: [300] Content-Type: application/json; charset=UTF-8 Content-Length: 792 Date: Thu, 06 Apr 2017 21:10:50 GMT Connection: keep-alive
RESP BODY: {"versions": [{"status": "CURRENT", "id": "v2.3", "links": [{"href": "http://(domain name with v2 in the string):9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.2", "links": [{"href": "http://(domain name with v2 in the string):9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.1", "links": [{"href": "http://(domain name with v2 in the string):9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v2.0", "links": [{"href": "http://(domain name with v2 in the string):9292/v2/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v1.1", "links": [{"href": "http://(domain name with v2 in the string):9292/v1/", "rel": "self"}]}, {"status": "SUPPORTED", "id": "v1.0", "links": [{"href": "http://(domain name with v2 in the string):9292/v1/", "rel": "self"}]}]}
'images'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/cliff/app.py", line 374, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/lib/python2.7/dist-packages/openstackclient/common/command.py", line 38, in run
return super(Command, self).run(parsed_args)
File "/usr/lib/python2.7/dist-packages/cliff/display.py", line 92, in run
column_names, data = self.take_action(parsed_args)
File "/usr/lib/python2.7/dist-packages/openstackclient/image/v2/image.py", line 496, in take_action
data = image_client.api.image_list(**kwargs)
File "/usr/lib/python2.7/dist-packages/openstackclient/api/image_v2.py", line 74, in image_list
return self.list(url, **filter)['images']
KeyError: 'images'
clean_up ListImage: 'images'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/openstackclient/shell.py", line 118, in run
ret_val = super(OpenStackShell, self).run(argv)
File "/usr/lib/python2.7/dist-packages/cliff/app.py", line 255, in run
result = self.run_subcommand(remainder)
File "/usr/lib/python2.7/dist-packages/openstackclient/shell.py", line 153, in run_subcommand
ret_value = super(OpenStackShell, self).run_subcommand(argv)
File "/usr/lib/python2.7/dist-packages/cliff/app.py", line 374, in run_subcommand
result = cmd.run(parsed_args)
File "/usr/lib/python2.7/dist-packages/openstackclient/common/command.py", line 38, in run
return super(Command, self).run(parsed_args)
File "/usr/lib/python2.7/dist-packages/cliff/display.py", line 92, in run
column_names, data = self.take_action(parsed_args)
File "/usr/lib/python2.7/dist-packages/openstackclient/image/v2/image.py", line 496, in take_action
data = image_client.api.image_list(**kwargs)
Yes, the version discovery had not been implemented in osc yet[1], but we start trying to support it[2], please add you advise in that patch, any feedback is valuable for us, thank you.
[1]: https:/ /github. com/openstack/ python- openstackclient /blob/master/ openstackclient /api/image_ v2.py#L25 /review. openstack. org/#/c/ 451618/
[2]: https:/