From c77078bf049ef1770ed9276f9bfbb9486beeb2ad Mon Sep 17 00:00:00 2001 From: Gagan Deep Date: Mon, 22 Jan 2024 22:04:21 +0530 Subject: [PATCH] [tests] Fixed failing test Rebased on latest master --- netjsonconfig/backends/openwrt/openwrt.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/netjsonconfig/backends/openwrt/openwrt.py b/netjsonconfig/backends/openwrt/openwrt.py index 84a168d9d..956d7f1ae 100644 --- a/netjsonconfig/backends/openwrt/openwrt.py +++ b/netjsonconfig/backends/openwrt/openwrt.py @@ -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. @@ -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 @@ -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.' )