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
commit 0a461380a3
21 changed files with 42 additions and 42 deletions

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