Glance endpoint issue with stripping path

Bug #1717961 reported by Curtis Collicutt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Shade
New
Undecided
Unassigned

Bug Description

Hi,

I have a Keystone catalog that uses api.somecloud.com/someservice/ as the endpoints. I have run into an issue (with Ansible, which uses Shade) in that the /someservice/ is stripped from the endpoint with Shade.

Glance endpoint:

$ os catalog show image
+-----------+---------------------------------------------------+
| Field | Value |
+-----------+---------------------------------------------------+
| endpoints | region1 |
| | admin: https://api.somecloud.com/image/ |
| | region1 |
| | public: https://api.somecloud.com/image/ |
| | region1 |
| | internal: https://api.somecloud.com/image/ |
| | |
| name | Image Service |
| type | image |
+-----------+---------------------------------------------------+

Here I'm just in ipython running list_images(). The URL used should be https://api.somecloud.com/image/v2/images, but instead it's https://api.somecloud.com/v2/images.

In [21]: cloud.list_images()
---------------------------------------------------------------------------
OpenStackCloudHTTPError Traceback (most recent call last)
<ipython-input-21-2af9c885b97c> in <module>()
----> 1 cloud.list_images()

/home/ubuntu/venv/shade/local/lib/python2.7/site-packages/shade/openstackcloud.pyc in list_images(self, filter_deleted, show_all)
   2135 endpoint = '/images/detail'
   2136
-> 2137 response = self._image_client.get(endpoint, params=params)
   2138
   2139 except keystoneauth1.exceptions.catalog.EndpointNotFound:

/home/ubuntu/venv/shade/local/lib/python2.7/site-packages/keystoneauth1/adapter.pyc in get(self, url, **kwargs)
    302
    303 def get(self, url, **kwargs):
--> 304 return self.request(url, 'GET', **kwargs)
    305
    306 def head(self, url, **kwargs):

/home/ubuntu/venv/shade/local/lib/python2.7/site-packages/shade/_adapter.pyc in request(self, url, method, run_async, error_message, *args, **kwargs)
    156 return response
    157 else:
--> 158 return self._munch_response(response, error_message=error_message)
    159
    160 def _version_matches(self, version):

/home/ubuntu/venv/shade/local/lib/python2.7/site-packages/shade/_adapter.pyc in _munch_response(self, response, result_key, error_message)
    112
    113 def _munch_response(self, response, result_key=None, error_message=None):
--> 114 exc.raise_from_response(response, error_message=error_message)
    115
    116 if not response.content:

/home/ubuntu/venv/shade/local/lib/python2.7/site-packages/shade/exc.pyc in raise_from_response(response, error_message)
    161 raise OpenStackCloudBadRequest(msg, response=response)
    162 if msg:
--> 163 raise OpenStackCloudHTTPError(msg, response=response)

OpenStackCloudHTTPError: (503) Server Error for url: https://api.somecloud.com/v2/images Service Unavailable (Inner Exception: Expecting value: line 1 column 1 (char 0))

Shade version:

$ pip show shade
Name: shade
Version: 1.23.0
Summary: Simple client library for interacting with OpenStack clouds
Home-page: http://docs.openstack.org/shade/latest
Author: OpenStack
Author-email: <email address hidden>
License: UNKNOWN
Location: /home/ubuntu/venv/shade/lib/python2.7/site-packages
Requires: requestsexceptions, Babel, dogpile.cache, keystoneauth1, decorator, netifaces, pbr, munch, python-ironicclient, iso8601, python-keystoneclient, six, ipaddress, jmespath, jsonpatch, futures, os-client-config

I'm fully OK with hearing that this kind of endpoint setup is not supported or a bad idea, but if it seems like an OK way to setup a catalog then it appears Shade can't use it. So far this catalog has worked with every other tool I've been using, but it's not an exhaustive list. So far all other endpoints work OK with Shade.

Thanks,
Curtis.

Revision history for this message
Curtis Collicutt (6-curtis) wrote :

Opened this in storyboard which I believe is the right place for issues for shade? https://storyboard.openstack.org/#!/story/2001203

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.