Skip to content

Commit

Permalink
[req-change] Changed zt interface path to /etc/openwisp/zerotier
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryamanz29 committed Aug 23, 2023
1 parent b226a66 commit a07e093
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/source/backends/zerotier.rst
Expand Up @@ -328,7 +328,7 @@ Will be rendered as:
package zerotier
config zerotier 'ow_zt'
option config_path '/etc/ow_zerotier_extra'
option config_path '/etc/openwisp/zerotier'
option copy_config_path '1'
option enabled '1'
list join '9536600adf654321'
Expand Down
4 changes: 2 additions & 2 deletions netjsonconfig/backends/openwrt/converters/zerotier.py
Expand Up @@ -15,7 +15,7 @@ def __intermediate_vpn(self, vpn):
{
'.name': self._get_uci_name(vpn.pop('name')),
'.type': 'zerotier',
'config_path': vpn.get('config_path', '/etc/ow_zerotier_extra'),
'config_path': vpn.get('config_path', '/etc/openwisp/zerotier'),
'copy_config_path': vpn.get('copy_config_path', '1'),
'join': [nwid_ifname.get('id', '') for nwid_ifname in nwid_ifnames],
'enabled': not vpn.pop('disabled', False),
Expand All @@ -36,7 +36,7 @@ def __netjson_vpn(self, vpn):
return super().__netjson_vpn(vpn)

def __get_zt_ifname_files(self, vpn, files):
config_path = vpn.get('config_path', '/etc/ow_zerotier_extra')
config_path = vpn.get('config_path', '/etc/openwisp/zerotier')
nwid_ifnames = vpn.get('nwid_ifname', [])
zt_file_contents = '# network_id=interface_name\n'

Expand Down
2 changes: 1 addition & 1 deletion netjsonconfig/backends/zerotier/zerotier.py
Expand Up @@ -20,7 +20,7 @@ def auto_client(
name='ow_zt',
nwid_ifname=None,
identity_secret='{{zt_identity_secret}}',
config_path='/etc/ow_zerotier_extra',
config_path='/etc/openwisp/zerotier',
disabled=False,
):
nwid_ifname = nwid_ifname or []
Expand Down
2 changes: 1 addition & 1 deletion tests/openwrt/test_backend.py
Expand Up @@ -554,7 +554,7 @@ def test_zerotier_auto_client(self):
'name': 'ow_zt',
'nwid_ifname': [],
'secret': '{{zt_identity_secret}}',
'config_path': '/etc/ow_zerotier_extra',
'config_path': '/etc/openwisp/zerotier',
'disabled': False,
}
]
Expand Down
10 changes: 5 additions & 5 deletions tests/openwrt/test_zerotier.py
Expand Up @@ -42,20 +42,20 @@ def test_zt_multiple_render_diff_name(self):
"""package zerotier
config zerotier 'ow_zt1'
option config_path '/etc/ow_zerotier_extra'
option config_path '/etc/openwisp/zerotier'
option copy_config_path '1'
option enabled '1'
list join '9536600adf654321'
config zerotier 'ow_zt2'
option config_path '/etc/ow_zerotier_extra'
option config_path '/etc/openwisp/zerotier'
option copy_config_path '1'
option enabled '1'
list join '9536600adf654322'
# ---------- files ---------- #
# path: /etc/ow_zerotier_extra/devicemap
# path: /etc/openwisp/zerotier/devicemap
# mode: 0644
# network_id=interface_name
Expand Down Expand Up @@ -104,15 +104,15 @@ def test_zt_multiple_render_same_name(self):
"""package zerotier
config zerotier 'ow_zt'
option config_path '/etc/ow_zerotier_extra'
option config_path '/etc/openwisp/zerotier'
option copy_config_path '1'
option enabled '1'
list join '9536600adf654321'
list join '9536600adf654322'
# ---------- files ---------- #
# path: /etc/ow_zerotier_extra/devicemap
# path: /etc/openwisp/zerotier/devicemap
# mode: 0644
# network_id=interface_name
Expand Down
2 changes: 1 addition & 1 deletion tests/zerotier/test_backend.py
Expand Up @@ -390,7 +390,7 @@ def test_auto_client(self):
'name': 'ow_zt',
'nwid_ifname': [{'id': '9536600adf654321', 'ifname': 'owzt654321'}],
'secret': 'test_secret',
'config_path': '/etc/ow_zerotier_extra',
'config_path': '/etc/openwisp/zerotier',
'disabled': False,
}
self.assertEqual(
Expand Down

0 comments on commit a07e093

Please sign in to comment.