Skip to content

Commit

Permalink
ns-migration: fix courtesy policies
Browse files Browse the repository at this point in the history
Avoid errors like:

  Traceback (most recent call last):
    File "/usr/share/ns-migration/20wan", line 87, in <module>
      mwan.store_policy(u, f'{i.get("name")}_only', [i])
    File "/usr/lib/python3.11/site-packages/nethsec/mwan/__init__.py", line 251, in store_policy
  • Loading branch information
gsanchietti committed Aug 20, 2024
1 parent 2e65d66 commit 3ddef00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ns-migration/files/scripts/wan
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ mwan.store_policy(u, policy_name, interfaces)

# generate one policy for each interface to ease divert rules creation
for i in interfaces:
mwan.store_policy(u, f'{i.get("name")}_only', [i])
pname = i.get("name")
# make sure to not exceed 12 chars
mwan.store_policy(u, f'{pname[0:6]}_only', [i])

# divert rule are not migrated

Expand Down

0 comments on commit 3ddef00

Please sign in to comment.