Ask Your Question

hg_mish's profile - activity

2018-12-10 09:11:08 -0500 commented question How to get region name in custom heat resource?

keystoneclient.v3.regions.RegionManager.list returns the same error "The service catalog is empty."

keystoneclient.v3.regions.RegionManager.get won't help because it needs region name as an argument and that is what I want to obtain

2018-12-09 22:47:04 -0500 received badge  Notable Question (source)
2018-12-09 22:47:04 -0500 received badge  Popular Question (source)
2018-12-06 11:35:39 -0500 asked a question How to get region name in custom heat resource?

I have an OpenStack deployment with 2 regions. Keystone and Horizon are common for both regions. And each region has its own Nova, Heat, Neutron, Glance etc.

I am writing a custom heat resource which should behave differently depending on the region in which the stack is created. Therefore, I am looking for a way to get the region name in the custom heat resource.

I tried to experiment with different methods of keystoneclient, i.e.:

auth = keystoneclient.auth.identity.v3.Token(
    auth_url=auth_url,
    token=token,
    reauthenticate=False)
session = keystoneclient.session.Session(auth=auth)

keystone_client = keystoneclient.v3.client.Client(session=session)

endpoint_manager = keystoneclient.v3.endpoints.EndpointManager(keystone_client)
endpoint_list = endpoint_manager.list()

This code returns an error:

2018-12-06 14:27:11.885 1305729 TRACE heat.engine.resource   File "/usr/lib/python2.7/site-packages/keystoneclient/service_catalog.py", line 216, in url_for
2018-12-06 14:27:11.885 1305729 TRACE heat.engine.resource     raise exceptions.EmptyCatalog(_('The service catalog is empty.'))
2018-12-06 14:27:11.885 1305729 TRACE heat.engine.resource EmptyCatalog: The service catalog is empty.

Is there a "standard" way of getting the region name of your "own" region?