File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,13 @@ def __init__(self, host=None):
46
46
agent = os .path .join (
47
47
os .path .abspath (os .path .dirname (__file__ )),
48
48
'agent.py' )
49
+ agent_prefix = os .environ .get ("LG_AGENT_PREFIX" , "" )
49
50
if host :
50
51
# copy agent.py and run via ssh
51
52
with open (agent , 'rb' ) as agent_fd :
52
53
agent_data = agent_fd .read ()
53
54
agent_hash = hashlib .sha256 (agent_data ).hexdigest ()
54
- agent_remote = f'.labgrid_agent_{ agent_hash } .py'
55
+ agent_remote = os . path . join ( agent_prefix , f'.labgrid_agent_{ agent_hash } .py' )
55
56
connect_timeout = get_ssh_connect_timeout ()
56
57
ssh_opts = f'ssh -x -o ConnectTimeout={ connect_timeout } -o PasswordAuthentication=no' .split ()
57
58
subprocess .check_call (
Original file line number Diff line number Diff line change @@ -124,6 +124,10 @@ CI pipelines where the username may not be consistent between pipeline stages.
124
124
.sp
125
125
Set the connection timeout when using SSH (The \fB ConnectTimeout \fP option). If
126
126
unspecified, defaults to 30 seconds.
127
+ .SS LG_AGENT_PREFIX
128
+ .sp
129
+ Add a prefix to \fB \& .labgrid_agent_{agent_hash}.py \fP allowing specification for
130
+ where on the exporter it should be uploaded to.
127
131
.SH MATCHES
128
132
.sp
129
133
Match patterns are used to assign a resource to a specific place. The format is:
Original file line number Diff line number Diff line change @@ -116,6 +116,11 @@ LG_SSH_CONNECT_TIMEOUT
116
116
Set the connection timeout when using SSH (The ``ConnectTimeout `` option). If
117
117
unspecified, defaults to 30 seconds.
118
118
119
+ LG_AGENT_PREFIX
120
+ ~~~~~~~~~~~~~~~~~~~~~~
121
+ Add a prefix to ``.labgrid_agent_{agent_hash}.py `` allowing specification for
122
+ where on the exporter it should be uploaded to.
123
+
119
124
MATCHES
120
125
-------
121
126
Match patterns are used to assign a resource to a specific place. The format is:
You can’t perform that action at this time.
0 commit comments