Skip to content

Commit

Permalink
[DPB]Fixing return code of breakout command on failure (sonic-net#3357)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgsudharsan authored and mssonicbld committed Jun 11, 2024
1 parent 0af03e7 commit 68f89d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def breakout_Ports(cm, delPorts=list(), portJson=dict(), force=False, \
click.echo("*** Printing dependencies ***")
for dep in deps:
click.echo(dep)
sys.exit(0)
sys.exit(1)
else:
click.echo("[ERROR] Port breakout Failed!!! Opting Out")
raise click.Abort()
Expand Down
4 changes: 2 additions & 2 deletions tests/config_dpb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def test_config_breakout_verbose(self, 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 'Dependencies Exist.' in result.output

# verbose must be set while creating instance of ConfigMgmt class
Expand Down Expand Up @@ -538,7 +538,7 @@ def config_dpb_port8_2x50G_1x100G():
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 'Dependencies Exist.' in result.output
assert 'Printing dependencies' in result.output
assert 'NO-NSW-PACL-V4' in result.output
Expand Down

0 comments on commit 68f89d6

Please sign in to comment.