Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/man/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ LG_AGENT_PREFIX
Add a prefix to ``.labgrid_agent_{agent_hash}.py`` allowing specification for
where on the exporter it should be uploaded to.

LG_AGENT_PYTHON
~~~~~~~~~~~~~~~
Specify python executable other the the default ``python3``. By pointing
to an executable in a particular virtual environment, use this environment
and its packages to run the agent and any agent-wrapped code.

Matches
-------
Match patterns are used to assign a resource to a specific place. The format is:
Expand Down
5 changes: 3 additions & 2 deletions labgrid/util/agentwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def __init__(self, host=None):
os.path.abspath(os.path.dirname(__file__)),
'agent.py')
agent_prefix = os.environ.get("LG_AGENT_PREFIX", "")
python_exe = os.environ.get("LG_AGENT_PYTHON", "python3")
if host:
# copy agent.py and run via ssh
with open(agent, 'rb') as agent_fd:
Expand All @@ -60,15 +61,15 @@ def __init__(self, host=None):
f'{host}:{agent_remote}'],
)
self.agent = subprocess.Popen(
ssh_opts + [host, '--', 'python3', agent_remote],
ssh_opts + [host, '--', python_exe, agent_remote],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
start_new_session=True,
)
else:
# run locally
self.agent = subprocess.Popen(
['python3', agent],
[python_exe, agent],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
start_new_session=True,
Expand Down
5 changes: 5 additions & 0 deletions man/labgrid-client.1
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,11 @@ unspecified, defaults to 30 seconds.
.sp
Add a prefix to \fB\&.labgrid_agent_{agent_hash}.py\fP allowing specification for
where on the exporter it should be uploaded to.
.SS LG_AGENT_PYTHON
.sp
Specify python executable other the the default \fBpython3\fP\&. By pointing
to an executable in a particular virtual environment, use this environment
and its packages to run the agent and any agent\-wrapped code.
.SH MATCHES
.sp
Match patterns are used to assign a resource to a specific place. The format is:
Expand Down