From 30f5dd67087b6fe90458629bd4789cec96584600 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com> Date: Wed, 5 Jan 2022 09:14:30 +0800 Subject: [PATCH] Update the example for pfcwd start command (#1984) What I did The example of pfcwd start command in start function comments is a little confused, after execution, it says invalid options. Update it with a correct command. The output of the current example is: admin@vlab-01:~$ sudo pfcwd start --action drop ports all detection-time 400 --restoration-time 400 Failed to run command, invalid options: ports detection-time How I did it Update the example with a correct one in pfcwd start function comments which is also usage info for pfcwd start command. How to verify it Enter SONiC DUT, input the following command: sudo pfcwd start --help sudo pfcwd start --action drop all 400 --restoration-time 400 Signed-off-by: Zhaohui Sun --- config/main.py | 2 +- doc/Command-Reference.md | 4 ++-- pfcwd/main.py | 2 +- tests/pfcwd_test.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/main.py b/config/main.py index 4e2ae68de667..00c0a0179777 100644 --- a/config/main.py +++ b/config/main.py @@ -2061,7 +2061,7 @@ def start(action, restoration_time, ports, detection_time, verbose): Start PFC watchdog on port(s). To config all ports, use all as input. Example: - config pfcwd start --action drop ports all detection-time 400 --restoration-time 400 + config pfcwd start --action drop all 400 --restoration-time 400 """ cmd = "pfcwd start" diff --git a/doc/Command-Reference.md b/doc/Command-Reference.md index 2b61c43d8316..535746af7b46 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -6172,8 +6172,8 @@ This command starts PFC Watchdog - Usage: ``` - config pfcwd start --action drop ports all detection-time 400 --restoration-time 400 - config pfcwd start --action forward ports Ethernet0 Ethernet8 detection-time 400 + config pfcwd start --action drop all 400 --restoration-time 400 + config pfcwd start --action forward Ethernet0 Ethernet8 400 ``` **config pfcwd stop** diff --git a/pfcwd/main.py b/pfcwd/main.py index c3b92fd2236c..4d3e73fb75f0 100644 --- a/pfcwd/main.py +++ b/pfcwd/main.py @@ -455,7 +455,7 @@ def start(db, action, restoration_time, ports, detection_time): Example: - sudo pfcwd start --action drop ports all detection-time 400 --restoration-time 400 + sudo pfcwd start --action drop all 400 --restoration-time 400 """ PfcwdCli(db).start( diff --git a/tests/pfcwd_test.py b/tests/pfcwd_test.py index c150c0568b68..4cb95cf8db06 100644 --- a/tests/pfcwd_test.py +++ b/tests/pfcwd_test.py @@ -118,7 +118,7 @@ def test_pfcwd_start_ports_valid(self, mock_os): @patch('pfcwd.main.os') def test_pfcwd_start_actions(self, mock_os): - # pfcwd start --action fwd --restoration-time 200 Ethernet0 200 + # pfcwd start --action forward --restoration-time 200 Ethernet0 200 import pfcwd.main as pfcwd runner = CliRunner() db = Db()