diff options
| author | wanghong <w.wanghong@huawei.com> | 2014-08-01 11:02:15 +0800 |
|---|---|---|
| committer | wanghong <w.wanghong@huawei.com> | 2014-08-14 20:17:54 +0800 |
| commit | 99ad9ef92e73d49bb6966a5a2a01ca6ccaf9d135 (patch) | |
| tree | 657d2ec83fe327f3fd5fb3f33b4537d62a921fbd /openstackclient/identity | |
| parent | 0cfd0b1da75d6acc2b9895eef9ac16c04f048001 (diff) | |
| download | python-openstackclient-99ad9ef92e73d49bb6966a5a2a01ca6ccaf9d135.tar.gz | |
add tests for identity v3 endpoint
Change-Id: I1479460473656ea4e2a48a976808371e840b49c1
Closes-Bug: #1348867
Diffstat (limited to 'openstackclient/identity')
| -rw-r--r-- | openstackclient/identity/v3/endpoint.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/openstackclient/identity/v3/endpoint.py b/openstackclient/identity/v3/endpoint.py index 4ea44e7a..5ab5dac4 100644 --- a/openstackclient/identity/v3/endpoint.py +++ b/openstackclient/identity/v3/endpoint.py @@ -165,13 +165,12 @@ class SetEndpoint(command.Command): '--enable', dest='enabled', action='store_true', - default=True, help='Enable endpoint', ) enable_group.add_argument( '--disable', - dest='enabled', - action='store_false', + dest='disabled', + action='store_true', help='Disable endpoint', ) return parser @@ -183,7 +182,8 @@ class SetEndpoint(command.Command): parsed_args.endpoint) if (not parsed_args.interface and not parsed_args.url - and not parsed_args.service and not parsed_args.region): + and not parsed_args.service and not parsed_args.region + and not parsed_args.enabled and not parsed_args.disabled): sys.stdout.write("Endpoint not updated, no arguments present") return @@ -192,13 +192,19 @@ class SetEndpoint(command.Command): service = common.find_service(identity_client, parsed_args.service) service_id = service.id + enabled = None + if parsed_args.enabled: + enabled = True + if parsed_args.disabled: + enabled = False + identity_client.endpoints.update( endpoint.id, service=service_id, url=parsed_args.url, interface=parsed_args.interface, region=parsed_args.region, - enabled=parsed_args.enabled + enabled=enabled ) return |
