Skip to content

Commit

Permalink
Update the example for pfcwd start command (sonic-net#1984)
Browse files Browse the repository at this point in the history
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 <zhaohuisun@microsoft.com>
  • Loading branch information
ZhaohuiS authored Jan 5, 2022
1 parent 9e30871 commit 30f5dd6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions doc/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down
2 changes: 1 addition & 1 deletion pfcwd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/pfcwd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 30f5dd6

Please sign in to comment.