diff --git a/pfcwd/main.py b/pfcwd/main.py index 9b038316ca..99118e0638 100644 --- a/pfcwd/main.py +++ b/pfcwd/main.py @@ -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) diff --git a/tests/pfcwd_test.py b/tests/pfcwd_test.py index 9a97ff7b33..bbd50f4220 100644 --- a/tests/pfcwd_test.py +++ b/tests/pfcwd_test.py @@ -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 @@ -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