From 3e95a1cd0721924e89e2cfd2960d4736bc6c5588 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Tue, 23 Aug 2016 14:27:51 +0800 Subject: when create/get/update failed return None rather than False In openstack_util.py, when create/get/update network or other resources failed, False is returned, which is incompatible with success return value such as id, network_nic. JIRA: FUNCTEST-427 Change-Id: Id2f55d8524e5aff150ba6bfb799085377a63baa4 Signed-off-by: SerenaFeng --- testcases/features/promise.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'testcases/features') diff --git a/testcases/features/promise.py b/testcases/features/promise.py index 170f75494..f5db02617 100755 --- a/testcases/features/promise.py +++ b/testcases/features/promise.py @@ -87,7 +87,7 @@ def main(): logger.info("Creating tenant '%s'..." % TENANT_NAME) tenant_id = openstack_utils.create_tenant( keystone, TENANT_NAME, TENANT_DESCRIPTION) - if tenant_id == '': + if not tenant_id: logger.error("Error : Failed to create %s tenant" % TENANT_NAME) exit(-1) logger.debug("Tenant '%s' created successfully." % TENANT_NAME) @@ -114,7 +114,7 @@ def main(): user_id = openstack_utils.create_user( keystone, USER_NAME, USER_PWD, None, tenant_id) - if user_id == '': + if not user_id: logger.error("Error : Failed to create %s user" % USER_NAME) exit(-1) logger.debug("User '%s' created successfully." % USER_NAME) @@ -171,7 +171,7 @@ def main(): SUBNET_NAME, ROUTER_NAME, SUBNET_CIDR) - if network_dic is False: + if not network_dic: logger.error("Failed to create the private network...") exit(-1) -- cgit 1.2.3-korg