You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix usage of mac address patterns in schema.py to allow using variables #238
Hello,
Everytime i try to add a variable to BSSID field on a WiFi interface configured as station,
It breaks the JSON configuration after/during saving.
@lpalgarvio I am not sure I understood this, I shall try asap.
What i mean to explain is that if you write the first configuration via UI or paste it and then save it,
when you open the template again it will be changed to the second.
The templating is broken when a variable is used on the bssid field.
the pattern and maxLength being used there will probably not allow for a variable.
Not sure that's possible without refactoring, but should allow either macaddress or variable with macaddress.
changed the title [-]WiFi Station BSSID does not accept variable properly[/-][+]Fix usage of mac address patterns in schema.py to allow using variables[/+]on Jun 20, 2022
Activity
nemesifier commentedon Jun 19, 2022
@lpalgarvio I am not sure I understood this, I shall try asap.
lpalgarvio commentedon Jun 20, 2022
What i mean to explain is that if you write the first configuration via UI or paste it and then save it,
when you open the template again it will be changed to the second.
The templating is broken when a variable is used on the bssid field.
lpalgarvio commentedon Jun 20, 2022
The cause is likely this:
the pattern and maxLength being used there will probably not allow for a variable.
Not sure that's possible without refactoring, but should allow either macaddress or variable with macaddress.
Other places where this can be a problem:
Maybe we can just fix the formula here:
and remove maxLength.
lpalgarvio commentedon Jun 20, 2022
The new regex expression suggests this will work fine:
https://regex101.com/
([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([{]{2}.*[}]{2})|(\s)Test cases (first is a blank line):
[-]WiFi Station BSSID does not accept variable properly[/-][+]Fix usage of mac address patterns in schema.py to allow using variables[/+]Fix usage of mac address patterns in schema.py to allow using variabl…
Fix usage of mac address patterns in schema.py to allow using variabl…
lpalgarvio commentedon Jun 20, 2022
PR provided :)
lpalgarvio commentedon Jun 20, 2022
intended result

Allow variables in mac address patterns in schema.py (Closes openwisp…
[fix] Allow variables in mac address patterns in schema.py (Closes op…