Skip to content

Commit

Permalink
Added upper version limit to WifiWave2
Browse files Browse the repository at this point in the history
According to the documentation, new RouterOS version uses another
package.
  • Loading branch information
ytimenkov committed Dec 9, 2023
1 parent 09331da commit 6037553
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion plugins/module_utils/_api_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self,
# Mark as 'fully understood' if it is for at least one version
self.fully_understood = False
for dummy, dummy, unversioned in self.versioned:
if unversioned.fully_understood:
if not isinstance(unversioned, str) and unversioned.fully_understood:
self.fully_understood = True
break
self._current = None if self.needs_version else self.unversioned
Expand Down Expand Up @@ -1470,6 +1470,7 @@ def join_path(path):
),
('interface', 'wifiwave2'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand Down Expand Up @@ -1497,6 +1498,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'aaa'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand All @@ -1517,6 +1519,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'access-list'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
fields={
Expand All @@ -1540,6 +1543,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'cap'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
single_value=True,
fully_understood=True,
Expand All @@ -1559,6 +1563,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'capsman'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
single_value=True,
fully_understood=True,
Expand All @@ -1576,6 +1581,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'channel'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand All @@ -1592,6 +1598,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'configuration'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand Down Expand Up @@ -1620,6 +1627,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'datapath'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand All @@ -1638,6 +1646,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'interworking'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand Down Expand Up @@ -1678,6 +1687,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'provisioning'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('action', ),
Expand All @@ -1699,6 +1709,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'security'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand Down Expand Up @@ -1740,6 +1751,7 @@ def join_path(path):
),
('interface', 'wifiwave2', 'steering'): APIData(
versioned=[
('7.13', '>=', 'RouterOS 7.13 uses WiFi package'),
('7.8', '>=', VersionedAPIData(
fully_understood=True,
primary_keys=('name', ),
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/api_modify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ def has_backend(versioned_path_info):

if versioned_path_info.versioned is not None:
for dummy, dummy, unversioned in versioned_path_info.versioned:
if get_backend(unversioned) is not None:
if not isinstance(unversioned, str) and get_backend(unversioned) is not None:
return True

return False
Expand Down

0 comments on commit 6037553

Please sign in to comment.