summaryrefslogtreecommitdiff
path: root/openstackclient/identity/v3
diff options
context:
space:
mode:
authoryanpuqing <yanpq@awcloud.com>2019-05-20 06:47:44 +0000
committerLance Bragstad <lbragstad@gmail.com>2020-06-10 14:24:30 -0500
commitbff556c7c2e19d6162fb47929b91c155eba2a6ee (patch)
treec1932171b3f11422f4348f8c96f2b95797058afd /openstackclient/identity/v3
parentc14b4d7ea065005d60c21a1557694aa25c9f72f3 (diff)
downloadpython-openstackclient-4.0.1.tar.gz
Client should parse string to boolean for value 'is_domain'4.0.1
When we use "--property" parameter, client get lists these the value is string type, but the type of the value 'is_domain' should be boolean, so we should judge it and parse it. The patch parse string to boolean for value 'is_domain'. Co-Authored-By: Lance Bragstad <lbragstad@gmail.com> Conflict: Direct backports of this patch fail because the original tests proposed to the Victoria (master) branch included keystone ``options``. Support for ``options`` was added in: I9c3bdd741f28bf558267fb217818d947597ce13e This backport removes the ``options`` key from the expected values in the tests since feature support for ``options`` isn't going to be backported. Otherwise, the functionality of this change is fully tested like it is on later releases. Change-Id: I37c9eb854524bde3a1530bfe2e3a03810fb1a676 Task: 30039 Story: 2005246 (cherry picked from commit 533af9f1b2de40d98f69e83cdf89ecf254cf3879) (cherry picked from commit 19723aee18e2901e9250dd840a61359704baa170)
Diffstat (limited to 'openstackclient/identity/v3')
-rw-r--r--openstackclient/identity/v3/project.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py
index e819a0a8..1d6f1810 100644
--- a/openstackclient/identity/v3/project.py
+++ b/openstackclient/identity/v3/project.py
@@ -103,6 +103,14 @@ class CreateProject(command.ShowOne):
kwargs = {}
if parsed_args.property:
kwargs = parsed_args.property.copy()
+ if 'is_domain' in kwargs.keys():
+ if kwargs['is_domain'].lower() == "true":
+ kwargs['is_domain'] = True
+ elif kwargs['is_domain'].lower() == "false":
+ kwargs['is_domain'] = False
+ elif kwargs['is_domain'].lower() == "none":
+ kwargs['is_domain'] = None
+
kwargs['tags'] = list(set(parsed_args.tags))
try: