summaryrefslogtreecommitdiff
path: root/openstackclient/identity
diff options
context:
space:
mode:
authorwanghong <w.wanghong@huawei.com>2014-07-29 15:33:18 +0800
committerwanghong <w.wanghong@huawei.com>2014-08-04 02:00:21 +0000
commita9fb5fa102560d389a8a9f76ed572f1c4fc9944b (patch)
treef1d3ffc84d98a1d68c03a8e673d7067d7b947ba4 /openstackclient/identity
parent75e8490e54bf442b36534ea9c8b53c203b6a9938 (diff)
downloadpython-openstackclient-a9fb5fa102560d389a8a9f76ed572f1c4fc9944b.tar.gz
v3 endpoint set shouldn't always need service option
Change-Id: I71aab1ee4f467dc963e7afa7fc1c82b4255ea822 Closes-Bug: #1351121
Diffstat (limited to 'openstackclient/identity')
-rw-r--r--openstackclient/identity/v3/endpoint.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py
index fa1b8628..4ea44e7a 100644
--- a/openstackclient/identity/v3/endpoint.py
+++ b/openstackclient/identity/v3/endpoint.py
@@ -181,16 +181,20 @@ class SetEndpoint(command.Command):
identity_client = self.app.client_manager.identity
endpoint = utils.find_resource(identity_client.endpoints,
parsed_args.endpoint)
- service = common.find_service(identity_client, parsed_args.service)
if (not parsed_args.interface and not parsed_args.url
and not parsed_args.service and not parsed_args.region):
sys.stdout.write("Endpoint not updated, no arguments present")
return
+ service_id = None
+ if parsed_args.service:
+ service = common.find_service(identity_client, parsed_args.service)
+ service_id = service.id
+
identity_client.endpoints.update(
endpoint.id,
- service=service.id,
+ service=service_id,
url=parsed_args.url,
interface=parsed_args.interface,
region=parsed_args.region,