From 533af9f1b2de40d98f69e83cdf89ecf254cf3879 Mon Sep 17 00:00:00 2001 From: yanpuqing Date: Mon, 20 May 2019 06:47:44 +0000 Subject: Client should parse string to boolean for value 'is_domain' 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 Change-Id: I37c9eb854524bde3a1530bfe2e3a03810fb1a676 Task: 30039 Story: 2005246 --- openstackclient/identity/v3/project.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'openstackclient/identity') diff --git a/openstackclient/identity/v3/project.py b/openstackclient/identity/v3/project.py index e32da165..5e8ce829 100644 --- a/openstackclient/identity/v3/project.py +++ b/openstackclient/identity/v3/project.py @@ -106,6 +106,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: -- cgit v1.2.1