Skip to content

Commit

Permalink
Merge pull request #207 from atlanticwave-sdx/fix/issue_200
Browse files Browse the repository at this point in the history
Fix error on vlan reservation and add backward compatibility to Port.label_range
  • Loading branch information
italovalcy authored Aug 12, 2024
2 parents 5f40e1b + cdb79a6 commit 7346650
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdx_pce/topology/temanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _update_vlan_tags_table(self, domain_name: str, port_map: dict):
# port itself (v1), or from the services attached to it (v2).
label_range = self.get_port_obj_services_label_range(port)
if label_range is None:
label_range = port.label_range
label_range = port.vlan_range

# TODO: why is label_range sometimes None, and what to
# do when that happens?
Expand Down Expand Up @@ -884,7 +884,7 @@ def _reserve_vlan(self, domain: str, port: dict, request_id: str, tag=None):
if vlan_usage is UNUSED_VLAN:
available_tag = vlan_tag
else:
if vlan_table[tag] is UNUSED_VLAN:
if tag in vlan_table and vlan_table[tag] is UNUSED_VLAN:
available_tag = tag
else:
return None
Expand Down

0 comments on commit 7346650

Please sign in to comment.