Skip to content

Commit

Permalink
Make --verbose parameter taking an argument.
Browse files Browse the repository at this point in the history
Be sure, that after merging this commit all related default parameters awas changed (e.g. in Jenkins).
  • Loading branch information
voodam committed Sep 5, 2023
1 parent 259f798 commit b218856
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions helpers/tf_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ def defaults(self):
}
)

def inc_verbose(self):
verbose = int(self.config["General"]["Verbose"]) + 1
self.config["General"]["Verbose"] = str(verbose)
def set_v_level(self, level):
assert isinstance(level, int) or isinstance(level, str) and level.isdigit()
self.config["General"]["Verbose"] = str(level)

def set_duration(self, val):
try:
Expand Down
6 changes: 3 additions & 3 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ def usage():
try:
options, remainder = getopt.getopt(
sys.argv[1:],
"hvdt:T:fr:ER:a:nl:LCDZpIi:sS",
"hv:dt:T:fr:ER:a:nl:LCDZpIi:sS",
[
"help",
"verbose",
"verbose=",
"defaults",
"duration=",
"failfast",
Expand Down Expand Up @@ -145,7 +145,7 @@ def usage():
if opt in ("-f", "--failfast"):
fail_fast = True
if opt in ("-v", "--verbose"):
tf_cfg.cfg.inc_verbose()
tf_cfg.cfg.set_v_level(arg)
if opt in ("-t", "--duration"):
if not tf_cfg.cfg.set_duration(arg):
print("Invalid option: ", opt, arg)
Expand Down

0 comments on commit b218856

Please sign in to comment.