diff --git a/tests/configlet/util/base_test.py b/tests/configlet/util/base_test.py index 804c9d6f035..10176660eeb 100644 --- a/tests/configlet/util/base_test.py +++ b/tests/configlet/util/base_test.py @@ -1,12 +1,7 @@ #! /usr/bin/env python -import argparse import json -import jsonpatch import os -import sys -import time -import yaml from helpers import * from common import * diff --git a/tests/configlet/util/generic_patch.py b/tests/configlet/util/generic_patch.py index b1e4edddd71..bb15d0dca64 100644 --- a/tests/configlet/util/generic_patch.py +++ b/tests/configlet/util/generic_patch.py @@ -1,14 +1,10 @@ #! /usr/bin/env python -import argparse import json import jsonpatch import fnmatch import os import re -import sys -import time -import yaml from helpers import * from common import * @@ -156,7 +152,7 @@ def generic_patch_add_t0(duthost, skip_load=False, hack_apply=False): for fl in patch_files: sonic_fl = os.path.join("/etc/sonic", fl) duthost.copy(src=os.path.join(patch_add_t0_dir, fl), dest=sonic_fl) - res = duthost.shell(CMD.format(sonic_fl), module_ignore_errors=True) + duthost.shell(CMD.format(sonic_fl), module_ignore_errors=True) # HACK: TODO: There are scenarios, where it applies patch and still consider as failed # "...Error: After applying patch to config, there are still some parts not updated\n" @@ -202,7 +198,7 @@ def generic_patch_rm_t0(duthost, skip_load=False, hack_apply=False): for fl in patch_files: sonic_fl = os.path.join("/etc/sonic", fl) duthost.copy(src=os.path.join(patch_rm_t0_dir, fl), dest=sonic_fl) - res = duthost.shell(CMD.format(sonic_fl), module_ignore_errors=True) + duthost.shell(CMD.format(sonic_fl), module_ignore_errors=True) # HACK: TODO: There are scenarios, where it applies patch and still consider as failed # "...Error: After applying patch to config, there are still some parts not updated\n" diff --git a/tests/configlet/util/mock_for_switch.py b/tests/configlet/util/mock_for_switch.py index 526b257f093..77e0a4cd259 100644 --- a/tests/configlet/util/mock_for_switch.py +++ b/tests/configlet/util/mock_for_switch.py @@ -140,7 +140,7 @@ def config_reload(duthost, config_source="config_db", wait=60, start_bgp=False): assert ret["rc"] == 0, "failed to run err:{}".format(str(ret["stderr"])) if start_bgp: - res = duthost.shell("config bgp startup all") + duthost.shell("config bgp startup all") log_debug("config_reload started BGP") log_debug("wait for {}".format(wait)) @@ -180,7 +180,6 @@ def wait_until(timeout, interval, delay, condition, *args, **kwargs): time.sleep(interval) elapsed_time = time.time() - start_time - if elapsed_time >= timeout: - log_debug("%s is still False after %d seconds, exit with False" % (condition.__name__, timeout)) - return False + log_debug("%s is still False after %d seconds, exit with False" % (condition.__name__, timeout)) + return False