Python 3 compatibility: fix has_key

For Python 3.0, has_key() isn't supported already, it can be
replaced with in.

Change-Id: I86344ac971b1e0c75abe5fdd2cddab884daedd9e
Closes-Bug: #1797770
This commit is contained in:
zhulingjie 2018-10-08 01:34:55 -04:00 committed by Michele Baldessari
parent c1bf5d8b10
commit c2b0cb5d5e
1 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ def create_nova_connection(options):
insecure=options["insecure"],
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug=options.has_key("verbose"),
http_log_debug="verbose" in options,
endpoint_type=nova_endpoint_type)
else:
# OSP >= Ocata
@ -152,7 +152,7 @@ def create_nova_connection(options):
nova = client.Client(version,
region_name=region,
session=keystone_session, auth=keystone_auth,
http_log_debug=options.has_key("verbose"),
http_log_debug="verbose" in options,
endpoint_type=nova_endpoint_type)
try: