Skip to content

Commit 423b407

Browse files
ktbyersarthurguyon
andauthored
fix(mikrotik): fix remote_space_available valuerror (#3739)
Co-authored-by: aguyon <[email protected]>
1 parent 56e812a commit 423b407

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

netmiko/mikrotik/mikrotik_ssh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ def remote_space_available(self, search_pattern: str = "") -> int:
222222
sys_res = self.ssh_ctl_chan._send_command_timing_str(remote_cmd).splitlines()
223223
for res in sys_res:
224224
if "free-memory" in res:
225-
spaceMib = res.strip().replace("free-memory: ", "").replace("MiB", "")
226-
return int(float(spaceMib) * 1048576)
225+
space_str = res.strip().replace("free-memory: ", "")
226+
return self._format_to_bytes(space_str)
227227
raise ValueError("Unexpected output from remote_space_available")
228228

229229
def remote_file_size(

0 commit comments

Comments
 (0)