Fix incorrect use of is for comparisons.

See https://bugs.python.org/issue34850 for details.
This commit is contained in:
Matt Clay
2019-02-12 15:15:23 -08:00
parent cd7a144515
commit 0a461380a3
21 changed files with 42 additions and 42 deletions

View File

@@ -154,7 +154,7 @@ def signed_request(
if session_in_query:
query["X-Amz-Security-Token"] = session_token
if method is "GET":
if method == "GET":
body = ""
# Derived data
@@ -194,7 +194,7 @@ def signed_request(
url = "https://" + host + uri
if query_string is not "":
if query_string != "":
url = url + "?" + query_string
final_headers = {

View File

@@ -97,13 +97,13 @@ def run_commands(module, commands, check_rc=True):
def get_config(module, source='running', flags=None):
global _DEVICE_CONFIG
if source is 'running' and flags is None and _DEVICE_CONFIG is not None:
if source == 'running' and flags is None and _DEVICE_CONFIG is not None:
return _DEVICE_CONFIG
else:
conn = get_connection(module)
out = conn.get_config(source=source, flags=flags)
cfg = to_text(out, errors='surrogate_then_replace').strip()
if source is 'running' and flags is None:
if source == 'running' and flags is None:
_DEVICE_CONFIG = cfg
return cfg