Skip to content

Commit

Permalink
fix show techsupport error (#2597)
Browse files Browse the repository at this point in the history
*Modify the order of "--allow-process-stop" option, it belongs to 'generate_dump'.
  • Loading branch information
pettershao-ragilenetworks committed Jan 19, 2023
1 parent 3d8e9c6 commit db4683d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1352,15 +1352,15 @@ def techsupport(since, global_timeout, cmd_timeout, verbose, allow_process_stop,
if global_timeout:
cmd += " timeout --kill-after={}s -s SIGTERM --foreground {}m".format(COMMAND_TIMEOUT, global_timeout)

if allow_process_stop:
cmd += " -a"

if silent:
cmd += " generate_dump"
click.echo("Techsupport is running with silent option. This command might take a long time.")
else:
cmd += " generate_dump -v"

if allow_process_stop:
cmd += " -a"

if since:
cmd += " -s '{}'".format(since)

Expand Down
2 changes: 1 addition & 1 deletion tests/techsupport_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
([], 'generate_dump -v -t 5'),
(['--since', '2 days ago'], "generate_dump -v -s '2 days ago' -t 5"),
(['-g', '50'], 'timeout --kill-after=300s -s SIGTERM --foreground 50m generate_dump -v -t 5'),
(['--allow-process-stop'], '-a generate_dump -v -t 5'),
(['--allow-process-stop'], 'generate_dump -v -a -t 5'),
(['--silent'], 'generate_dump -t 5'),
(['--debug-dump', '--redirect-stderr'], 'generate_dump -v -d -t 5 -r'),
]
Expand Down

0 comments on commit db4683d

Please sign in to comment.