Skip to content

Commit 10a20e8

Browse files
authored
Merge pull request #444 from globocom/FLSTD-2165
added channel verification
2 parents b4b7054 + 82ebf39 commit 10a20e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

networkapi/api_channel/facade.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ def create(self, data):
6060
vlan_nativa = data.get('vlan')
6161
envs_vlans = data.get('envs_vlans')
6262

63+
### Verify if channel number is greater than 0 and smaller or equal to 4096
64+
if 0 > int(nome) > 4096:
65+
log.error("Channel %s must be between 0 and 4097." % nome)
66+
raise InterfaceError(
67+
"Channel %s must be between 0 and 4097." % nome
68+
)
69+
6370
api_interface_facade.verificar_vlan_nativa(vlan_nativa)
6471

6572
# Checks if Port Channel name already exists on equipment

0 commit comments

Comments
 (0)