Skip to content

Commit

Permalink
[tests] Fixed failing test
Browse files Browse the repository at this point in the history
Rebased on latest master
  • Loading branch information
pandafy committed Jan 22, 2024
1 parent e42b1d4 commit c77078b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions netjsonconfig/backends/openwrt/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(
super().__init__(config, native, templates, context)

def validate(self):
self._validate_radios()
super().validate()
# When VLAN filtering is enabled on a "bridge" interfaces,
# primary VLAN ID can be set for only one VLAN.
Expand Down Expand Up @@ -170,10 +171,6 @@ def zerotier_auto_client(cls, **kwargs):
data = ZeroTier.auto_client(**kwargs)
return {'zerotier': [data]}

def validate(self):
self._validate_radios()
super().validate()

def _validate_radios(self):
# We use "hwmode" or "band" property of "radio" configuration
# to predict the radio frequency. If both of these
Expand All @@ -189,7 +186,7 @@ def _validate_radios(self):
and radio.get('hwmode') is None
and radio.get('channel') == 0
):
raise ValidationError(
raise JsonSchemaError(
'"channel" cannot be set to "auto" when'
' "hwmode" or "band" property is not configured.'
)

0 comments on commit c77078b

Please sign in to comment.