Skip to content

Commit 7bba589

Browse files
committed
driver/sshdriver: fix caching of _ssh_version
map() returns an iterator, which only works once. Return and cache a tuple instead. Fixes: 2c062e3 ("driver/sshdriver: store OpenSSH version in cached property") Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
1 parent 430ec4c commit 7bba589

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

labgrid/driver/sshdriver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def get_status(self):
447447
def _ssh_version(self):
448448
version = subprocess.run(["ssh", "-V"], capture_output=True, text=True)
449449
version = re.match(r"^OpenSSH_(\d+)\.(\d+)", version.stderr)
450-
return map(int, version.groups())
450+
return tuple(int(x) for x in version.groups())
451451

452452
def _scp_supports_explicit_sftp_mode(self):
453453
major, minor = self._ssh_version

0 commit comments

Comments
 (0)