Skip to content

Commit

Permalink
Merge pull request #522 from kytos-ng/release/2024.1.4
Browse files Browse the repository at this point in the history
Backport: Ignored unordered special VLANS 2024.1
  • Loading branch information
Alopalao authored Dec 11, 2024
2 parents 552d3a7 + 3af44a8 commit 0c51ae5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to the kytos project will be documented in this file.
UNRELEASED - Under development
******************************

[2024.1.4] - 2024-12-09
***********************

Fixed
=====
- Order in ``interface.special_available_tags`` and ``interface.special_tags`` does not matter anymore when looking for used special tag.

[2024.1.3] - 2024-12-05
***********************

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
# built documents.
#
# The short X.Y version.
version = u'2024.1.3'
version = u'2024.1.4'
show_version = False
# The full version, including alpha/beta/rc tags.
release = u'2024.1.3'
release = u'2024.1.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
8 changes: 6 additions & 2 deletions kytos/core/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,12 @@ def all_tags_available(self) -> bool:
"""Return True if all tags are avaiable (no tags used),
False otherwise"""
with self._tag_lock:
return (self.available_tags == self.tag_ranges and
self.special_available_tags == self.special_tags)
if self.available_tags != self.tag_ranges:
return False
for field, ranges in self.special_available_tags.items():
if set(ranges) != set(self.special_tags[field]):
return False
return True

def set_tag_ranges(self, tag_ranges: list[list[int]], tag_type: str):
"""Set new restriction, tag_ranges."""
Expand Down
2 changes: 1 addition & 1 deletion kytos/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The present metadata is intended to be used mainly on the setup.
"""
__version__ = '2024.1.3'
__version__ = '2024.1.4'
__author__ = 'Kytos Team'
__author_email__ = 'devel@lists.kytos.io'
__license__ = 'MIT'
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_core/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,10 @@ def test_all_tags_available(self) -> None:
self.iface.special_available_tags = {"vlan": ["any"]}
assert self.iface.all_tags_available()

self.iface.special_available_tags = {"vlan": ["untagged", "any"]}
self.iface.special_tags = {"vlan": ["any", "untagged"]}
assert self.iface.all_tags_available()


class TestUNI():
"""UNI tests."""
Expand Down

0 comments on commit 0c51ae5

Please sign in to comment.