Make the kolla_keystone_service can update fields
Make the kolla_keystone_service can update the following fields * service.name * service.description * endpoint.url TrivialFix Change-Id: If239a518b0217cfc105388ae5e298a8904ac2af5
This commit is contained in:
parent
b6ee58fcdf
commit
cae30a913b
@ -55,19 +55,31 @@ def main():
|
|||||||
for _service in cloud.keystone_client.services.list():
|
for _service in cloud.keystone_client.services.list():
|
||||||
if _service.type == service_type:
|
if _service.type == service_type:
|
||||||
service = _service
|
service = _service
|
||||||
|
if service.name != service_name or \
|
||||||
if service is not None:
|
service.description != description:
|
||||||
for _endpoint in cloud.keystone_client.endpoints.list():
|
changed = True
|
||||||
if _endpoint.service_id == service.id and \
|
cloud.keystone_client.services.update(
|
||||||
_endpoint.interface == interface:
|
service,
|
||||||
endpoint = _endpoint
|
name=service_name,
|
||||||
|
description=description)
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
|
changed = True
|
||||||
service = cloud.keystone_client.services.create(
|
service = cloud.keystone_client.services.create(
|
||||||
name=service_name,
|
name=service_name,
|
||||||
service_type=service_type,
|
service_type=service_type,
|
||||||
description=description)
|
description=description)
|
||||||
|
|
||||||
if endpoint is None:
|
for _endpoint in cloud.keystone_client.endpoints.list():
|
||||||
|
if _endpoint.service_id == service.id and \
|
||||||
|
_endpoint.interface == interface:
|
||||||
|
endpoint = _endpoint
|
||||||
|
if endpoint.url != url:
|
||||||
|
changed = True
|
||||||
|
cloud.keystone_client.endpoints.update(
|
||||||
|
endpoint, url=url)
|
||||||
|
break
|
||||||
|
else:
|
||||||
changed = True
|
changed = True
|
||||||
cloud.keystone_client.endpoints.create(
|
cloud.keystone_client.endpoints.create(
|
||||||
service=service.id,
|
service=service.id,
|
||||||
|
Loading…
Reference in New Issue
Block a user