From 4e56d2b12c750ed61901f955eaa4a02bfcccdf68 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 2 Jul 2024 02:14:10 +0530 Subject: [PATCH] [DPB]Fix return code in case of failure (#3389) * [DPB]Fix return code in case of failure * Updating UT --- config/main.py | 2 +- tests/config_dpb_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/main.py b/config/main.py index b750b49820..1b08efd0a1 100644 --- a/config/main.py +++ b/config/main.py @@ -4582,7 +4582,7 @@ def breakout(ctx, interface_name, mode, verbose, force_remove_dependencies, load except Exception as e: click.secho("Failed to break out Port. Error: {}".format(str(e)), fg='magenta') - sys.exit(0) + sys.exit(1) def _get_all_mgmtinterface_keys(): """Returns list of strings containing mgmt interface keys diff --git a/tests/config_dpb_test.py b/tests/config_dpb_test.py index 58a24dc958..20def6650a 100644 --- a/tests/config_dpb_test.py +++ b/tests/config_dpb_test.py @@ -350,7 +350,7 @@ def test_config_breakout_extra_table_warning(self, breakout_cfg_file, sonic_db): commands["breakout"], ['{}'.format(interface), '{}'.format(newMode), '-v', '-y'], obj=obj) print(result.exit_code, result.output) - assert result.exit_code == 0 + assert result.exit_code == 1 assert 'Below Config can not be verified' in result.output assert 'UNKNOWN_TABLE' in result.output assert 'Do you wish to Continue?' in result.output