mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix incorrect use of is for comparisons.
See https://bugs.python.org/issue34850 for details.
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user