Skip to content

Commit 0a7bcd0

Browse files
authored
Merge pull request #1428 from Emantor/topic/ser2net-tcp
Exporter: always use tcp for ser2net
2 parents e5ace1a + a3dbfb5 commit 0a7bcd0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

labgrid/remote/exporter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,22 @@ def _start(self, start_params):
233233
# Ser2net has switched to using YAML format at version 4.0.0.
234234
result = subprocess.run([self.ser2net_bin, "-v"], capture_output=True, text=True)
235235
_, _, version = str(result.stdout).split(" ")
236-
major_version = version.split(".")[0]
236+
version = tuple(map(int, version.strip().split(".")))
237237

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

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

0 commit comments

Comments
 (0)