Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202012] [pfcwd] Fix the return code in invalid case #1698

Merged
merged 2 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pfcwd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def start(self, action, restoration_time, ports, detection_time):
click.echo("Failed to run command, invalid options:")
for opt in invalid_ports:
click.echo(opt)
exit()
exit(1)
self.start_cmd(action, restoration_time, ports, detection_time)


Expand Down
4 changes: 2 additions & 2 deletions tests/pfcwd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_pfcwd_start_ports_invalid(self):
obj=db
)
print(result.output)
assert result.exit_code == 0
assert result.exit_code == 1
assert result.output == pfcwd_show_start_config_output_fail

@classmethod
Expand Down Expand Up @@ -447,7 +447,7 @@ def test_pfcwd_start_ports_masic_invalid(self):
obj=db
)
print(result.output)
assert result.exit_code == 0
assert result.exit_code == 1
assert result.output == show_pfc_config_start_fail

# get config after the command, config shouldn't change
Expand Down