Skip to content

Commit

Permalink
lgtm warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
renukamanavalan committed Feb 16, 2022
1 parent 2d1a4b8 commit b399799
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
5 changes: 0 additions & 5 deletions tests/configlet/util/base_test.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down
8 changes: 2 additions & 6 deletions tests/configlet/util/generic_patch.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions tests/configlet/util/mock_for_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

0 comments on commit b399799

Please sign in to comment.