Skip to content

Commit 63826bb

Browse files
Bastian-KrauseEmantor
authored andcommitted
remote/client: fix forwarding of remote ports
'labgrid-client forward --remote' accidentally uses the variable 'localport', which is either not set at all (leading to a UnboundLocalError) if no --local/-L is set or is set to the LOCAL part of --local/-L, which is wrong. The LOCAL part of --remote/-R should be used instead. Fix that by using the correct variable 'local'. Note that the informational print used the correct variable already. Fixes: 51f3fe5 ("client: Add port forwarding") Signed-off-by: Bastian Krause <[email protected]>
1 parent a6660c6 commit 63826bb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGES.rst

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Bug fixes in 0.4.1
99

1010
- Fixed a bug where using ``labgrid-client io get`` always returned ``low``
1111
when reading a ``sysfsgpio``.
12+
- Fixed ``labgrid-client forward --remote``/``-R``, which used either the LOCAL
13+
part of ``--local``/``-L`` accidentally (if specified) or raised an
14+
UnboundLocalError.
1215

1316
Known issues in 0.4.1
1417
~~~~~~~~~~~~~~~~~~~~~~~~~

labgrid/remote/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ def forward(self):
11161116
print(f"Forwarding local port {localport:d} to remote port {remote:d}")
11171117

11181118
for local, remote in self.args.remote:
1119-
stack.enter_context(drv.forward_remote_port(remote, localport))
1119+
stack.enter_context(drv.forward_remote_port(remote, local))
11201120
print(f"Forwarding remote port {remote:d} to local port {local:d}")
11211121

11221122
try:

0 commit comments

Comments
 (0)