Skip to content

Commit

Permalink
[fix] Temptative fix of #235
Browse files Browse the repository at this point in the history
The test is misssing.

Fixes #235
  • Loading branch information
nemesifier committed Jun 1, 2023
1 parent 3b3eaab commit 705895d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openwisp_firmware_upgrader/upgraders/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def _reflash(self, path):
@classmethod
def _call_reflash_command(cls, upgrader, path, timeout, failure_queue):
try:
upgrader.connect()
upgrader.connection.connect()
command = upgrader.get_upgrade_command(path)
# remove persistent checksum if present (introduced in openwisp-config 0.6.0)
# otherwise the device will not download the configuration again after reflash
Expand All @@ -409,7 +409,10 @@ def _refresh_addresses(self):
"""
self.connection.device.refresh_from_db()
self.connection.refresh_from_db()
del self.connection.connector_instance
self.addresses = self.connection.get_addresses()
self._params = self.connector_instance._params
self.shell = self.connector_instance.shell

def _write_checksum(self, checksum):
for attempt in range(1, self.RECONNECT_MAX_RETRIES + 1):
Expand All @@ -424,7 +427,7 @@ def _write_checksum(self, checksum):
save=False,
)
try:
self.connect()
self.connection.connect()
except (NoValidConnectionsError, socket.timeout, SSHException) as error:
self.log(
_(
Expand Down

0 comments on commit 705895d

Please sign in to comment.