From 117588cfac55b6459d37de9edb43f1e49ae5a309 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Thu, 23 Dec 2021 02:46:33 +0000 Subject: [PATCH 1/2] example of pfcwd start command is a little confused, after execution, it says invalid options. Update it with a correct command Signed-off-by: Zhaohui Sun --- pfcwd/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pfcwd/main.py b/pfcwd/main.py index c3b92fd223..4d3e73fb75 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( From 035f06c03c90b09d002ac3e9c4d26722c1fe8668 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Tue, 4 Jan 2022 09:51:08 +0800 Subject: [PATCH 2/2] update other pfcwd start command examples Signed-off-by: Zhaohui Sun --- config/main.py | 2 +- doc/Command-Reference.md | 4 ++-- tests/pfcwd_test.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/main.py b/config/main.py index 5046275f6e..9c29b75889 100644 --- a/config/main.py +++ b/config/main.py @@ -2052,7 +2052,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 21a0b39e56..ffae7aac42 100644 --- a/doc/Command-Reference.md +++ b/doc/Command-Reference.md @@ -6154,8 +6154,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/tests/pfcwd_test.py b/tests/pfcwd_test.py index c150c0568b..4cb95cf8db 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()