use service catalog to grab the endpoint URL

This commit is contained in:
Arif Ali 2022-11-03 11:50:08 +00:00
parent 1e632d468e
commit 08d658e1f9
Signed by: arif
GPG Key ID: 369608FBA1353A70

View File

@ -16,6 +16,9 @@ def get_credentials(site_id):
creds['version'] = '2'
return creds
def get_keystoneclient(creds):
return keystone_auth(**creds)
def get_auth_token(creds):
keystone_client = keystone_auth(**creds)
@ -27,9 +30,10 @@ def get_servers(creds):
print(nova_client.servers.list())
def get_cores(creds):
url="http://placement.example.com:8778"
keystone = get_keystoneclient(creds)
token = keystone.auth_token
token = get_auth_token(creds)
url = keystone.service_catalog.get_endpoints(service_name="placement",endpoint_type="public")['placement'][0]['url']
headers = {}
headers['content-type'] = 'application/json'