Skip to content

Commit

Permalink
Merge pull request #1428 from Emantor/topic/ser2net-tcp
Browse files Browse the repository at this point in the history
Exporter: always use tcp for ser2net
  • Loading branch information
jluebbe committed Jun 21, 2024
2 parents e5ace1a + a3dbfb5 commit 0a7bcd0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions labgrid/remote/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,22 @@ def _start(self, start_params):
# Ser2net has switched to using YAML format at version 4.0.0.
result = subprocess.run([self.ser2net_bin, "-v"], capture_output=True, text=True)
_, _, version = str(result.stdout).split(" ")
major_version = version.split(".")[0]
version = tuple(map(int, version.strip().split(".")))

# There is a bug in ser2net between 4.4.0 and 4.6.1 where it
# returns 1 on a successful call to 'ser2net -v'. We don't want
# a failure because of this, so raise an error only if ser2net
# is not one of those versions.
if version.strip() not in ["4.4.0", "4.5.0", "4.5.1", "4.6.0", "4.6.1"] and result.returncode == 1:
if version not in [(4, 4, 0), (4, 5, 0), (4, 5, 1), (4, 6, 0), (4, 6, 1)] and result.returncode == 1:
raise ExporterError(f"ser2net {version} returned a nonzero code during version check.")

if int(major_version) >= 4:
if version >= (4, 2, 0):
cmd = [
self.ser2net_bin,
"-d",
"-n",
"-Y",
f"connection: &con01# accepter: telnet(rfc2217,mode=server),{self.port}",
f"connection: &con01# accepter: telnet(rfc2217,mode=server),tcp,{self.port}",
"-Y",
f' connector: serialdev(nouucplock=true),{start_params["path"]},{self.local.speed}n81,local', # pylint: disable=line-too-long
"-Y",
Expand Down

0 comments on commit 0a7bcd0

Please sign in to comment.