Skip to content

Commit 457e443

Browse files
authored
Merge branch 'master' into Fx-VPN-templates-conflict
2 parents 4acbfd8 + c39c916 commit 457e443

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

openwisp_controller/connection/connectors/openwrt/ssh.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
class OpenWrt(Ssh):
1111
def update_config(self):
1212
try:
13-
output, exit_code = self.exec_command('openwisp_config --version')
13+
output, exit_code = self.exec_command(
14+
# "openwisp_config" for backword compatibility
15+
'(openwisp-config --version || openwisp_config --version) 2>/dev/null'
16+
)
1417
except Exception as error:
15-
logger.error('Unable to get version of openwisp_config')
18+
logger.error('Unable to get version of openwisp-config')
1619
raise error
1720
else:
1821
ow_config_version = output.split(' ')[-1]

openwisp_controller/connection/tests/test_models.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,10 @@ def test_device_config_created(self, mocked_sleep, mocked_connect):
933933
def test_device_config_update(self, mocked_sleep, mocked_connect):
934934
def _assert_version_check_command(mocked_exec):
935935
args, _ = mocked_exec.call_args_list[0]
936-
self.assertEqual(args[0], 'openwisp_config --version')
936+
self.assertEqual(
937+
args[0],
938+
'(openwisp-config --version || openwisp_config --version) 2>/dev/null',
939+
)
937940

938941
def _assert_applying_conf_test_command(mocked_exec):
939942
args, _ = mocked_exec_command.call_args_list[1]
@@ -944,7 +947,7 @@ def _assert_applying_conf_test_command(mocked_exec):
944947

945948
conf = self._prepare_conf_object()
946949

947-
with self.subTest('Unable to get openwisp_config version'):
950+
with self.subTest('Unable to get openwisp-config version'):
948951
with mock.patch(_exec_command_path) as mocked_exec_command:
949952
mocked_exec_command.return_value = self._exec_command_return_value(
950953
exit_code=1

0 commit comments

Comments
 (0)