-
-
Notifications
You must be signed in to change notification settings - Fork 229
[fix] Update zerotier network name from ow_zt to global #986
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
Merged
nemesifier
merged 13 commits into
openwisp:master
from
filippociandy10:filippociandy/ow_zt-to-global
Mar 20, 2025
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5088a1c
Implemented change zerotier network name from ow_zt to global
filippociandy10 ce4f006
Fixed and test migrations
2e7c75e
Fixed changes requested
448cf69
[chores] Fixed whitespace in 0056_ow_zt-to-global.py
nemesifier 7b24195
Changed file name and resolve qa check
22a0382
Merge branch 'master' into filippociandy/ow_zt-to-global
filippociandy10 456c201
Update openwisp_controller/config/migrations/0056_ow_zt_to_global.py
filippociandy10 6411f82
[fix] Ensure updated templates are saved #982\n\nFix issue in openwis…
2d2a981
[fix] Ensure updated templates are saved #982
40062ca
[fix] Ensure updated templates are saved #982
5b5db6f
[fix] Removed duplicate import and user iterator to loop over templates
pandafy b03782b
Merge branch 'master' into filippociandy/ow_zt-to-global
nemesifier 7133d29
[chores] Reformatted, renamed for clarity, updated previous migrations
nemesifier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
openwisp_controller/config/migrations/0056_ow_zt_to_global.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| from django.db import migrations | ||
| import json | ||
|
|
||
|
|
||
| def change_owzt_to_global(apps, schema_editor): | ||
| Template = apps.get_model('config', 'Template') | ||
| for template in Template.objects.filter( | ||
| type='vpn', vpn__backend='openwisp_controller.vpn_backends.ZeroTier'): | ||
| config = json.loads(template.config) | ||
| if 'zerotier' in config: | ||
| for item in config.get('zerotier', []): | ||
| if item.get('name') == 'ow_zt': | ||
| item['name'] = 'global' | ||
filippociandy10 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [('config', '0055_alter_config_status')] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython( | ||
| change_owzt_to_global, reverse_code=migrations.RunPython.noop) | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.