Skip to content

Commit db4683d

Browse files
fix show techsupport error (sonic-net#2597)
*Modify the order of "--allow-process-stop" option, it belongs to 'generate_dump'.
1 parent 3d8e9c6 commit db4683d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

show/main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1352,15 +1352,15 @@ def techsupport(since, global_timeout, cmd_timeout, verbose, allow_process_stop,
13521352
if global_timeout:
13531353
cmd += " timeout --kill-after={}s -s SIGTERM --foreground {}m".format(COMMAND_TIMEOUT, global_timeout)
13541354

1355-
if allow_process_stop:
1356-
cmd += " -a"
1357-
13581355
if silent:
13591356
cmd += " generate_dump"
13601357
click.echo("Techsupport is running with silent option. This command might take a long time.")
13611358
else:
13621359
cmd += " generate_dump -v"
13631360

1361+
if allow_process_stop:
1362+
cmd += " -a"
1363+
13641364
if since:
13651365
cmd += " -s '{}'".format(since)
13661366

tests/techsupport_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
([], 'generate_dump -v -t 5'),
1313
(['--since', '2 days ago'], "generate_dump -v -s '2 days ago' -t 5"),
1414
(['-g', '50'], 'timeout --kill-after=300s -s SIGTERM --foreground 50m generate_dump -v -t 5'),
15-
(['--allow-process-stop'], '-a generate_dump -v -t 5'),
15+
(['--allow-process-stop'], 'generate_dump -v -a -t 5'),
1616
(['--silent'], 'generate_dump -t 5'),
1717
(['--debug-dump', '--redirect-stderr'], 'generate_dump -v -d -t 5 -r'),
1818
]

0 commit comments

Comments
 (0)