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:
@@ -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