Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(migration): handle truncated wan #1073

Merged
merged 2 commits into from
Feb 24, 2025
Merged

fix(migration): handle truncated wan #1073

merged 2 commits into from
Feb 24, 2025

Conversation

gsanchietti
Copy link
Member

@gsanchietti gsanchietti requested a review from Tbaile February 11, 2025 13:17
Avoid the following error when there is a conflict of names:

Traceback (most recent call last):
  File "/usr/share/ns-migration/20wan", line 89, in <module>
    mwan.store_policy(u, f'{pname[0:6]}_only', [i])
  File "/usr/lib/python3.11/site-packages/nethsec/mwan/__init__.py", line 257, in store_policy
nethsec.utils.ValidationError: ('name', 'unique', 'timene_only')
Before the commit, if a network was truncated to 15 chars, the new short name
was used inside the `network` config database but not inside the
`firewall` database: the firewall zone was pointing to a non existing
network,

Example:

- original name of the interface was 'timenet_ftth_12345'

- value saved inside the network db:

    config interface 'timenet_ftth_1'
        option proto 'static'

- value saved inside 'firewall' db:

    config zone 'ns_wan'
        option name 'wan'
        option output 'ACCEPT'
        option input 'DROP'
        option forward 'REJECT'
        list network 'timenet_ftth_12345'
@Tbaile Tbaile merged commit 6f17bcc into main Feb 24, 2025
1 check passed
@Tbaile Tbaile deleted the issue1067 branch February 24, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants