Skip to content

Commit

Permalink
Fixed a bug where the wrong card type was asserted when creating a se…
Browse files Browse the repository at this point in the history
…rvice-port
  • Loading branch information
janis-gross committed Sep 22, 2020
1 parent 2d790be commit 8df38c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Failure: Service virtual port has existed already
Conflicted service virtual port index: {{ context.service_port.name }}



10 changes: 5 additions & 5 deletions vendors/Huawei/configCommandProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def do_service_port(self, command, *args, context=None):
try:
port = self._model.get_port('name', port_idx)
except exceptions.SoftboxenError:
raise exceptions.CommandSyntaxError(command=command)
raise exceptions.CommandSyntaxError(command=command) # FIXME: parameter error
if args[5] == 'ont':
ont_idx = args[6]
ont_port_idx = args[8]
Expand Down Expand Up @@ -511,7 +511,7 @@ def do_service_port(self, command, *args, context=None):

try:
card = self._model.get_card('id', port.card_id)
assert (card.product == 'vdsl') or (card.product == 'xdsl')
assert card.product in ('adsl', 'vdsl', 'xdsl')
except (exceptions.SoftboxenError, AssertionError):
service_vlan.delete()
service_port.delete()
Expand All @@ -531,7 +531,7 @@ def do_service_port(self, command, *args, context=None):
'index', str)
try:
card = self._model.get_card('id', port.card_id)
assert (card.product == 'vdsl') or (card.product == 'xdsl')
assert card.product in ('adsl', 'vdsl', 'xdsl')
except (exceptions.SoftboxenError, AssertionError):
service_vlan.delete()
service_port.delete()
Expand Down Expand Up @@ -569,7 +569,7 @@ def do_service_port(self, command, *args, context=None):
'untagged'):
try:
card = self._model.get_card('id', port.card_id)
assert card.product == 'vdsl'
assert card.product in ('adsl', 'vdsl', 'xdsl')
except (exceptions.SoftboxenError, AssertionError):
service_vlan.delete()
service_port.delete()
Expand All @@ -585,7 +585,7 @@ def do_service_port(self, command, *args, context=None):
str, 'multi-service', 'user-vlan', 'untagged')
try:
card = self._model.get_card('id', port.card_id)
assert (card.product == 'adsl') or (card.product == 'xdsl')
assert card.product in ('adsl', 'vdsl', 'xdsl')
except (exceptions.SoftboxenError, AssertionError):
service_vlan.delete()
service_port.delete()
Expand Down

0 comments on commit 8df38c3

Please sign in to comment.