Skip to content

Commit e3180cb

Browse files
Bastian-KrauseEmantor
authored andcommitted
remote/exporter: pass proxy information to ResourceEntry
ResourceEntry objects do not have proxy attributes (contrary to ResourceExports). Resources such as NetworkPowerPorts or ModbusTCPCoils are ResourceEntry objects, but need this information in case its exporter is run in isolated mode (-i, --isolated). In this case a SSH port forwarding is needed to access the device via the exporter. Allow that by passing the proxy information as part of the ResourceEntry's data. Signed-off-by: Bastian Krause <[email protected]>
1 parent b97c44c commit e3180cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

labgrid/remote/exporter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,10 @@ async def add_resource(self, group_name, resource_name, cls, params):
777777
group[resource_name] = export_cls(config, host=self.hostname, proxy=getfqdn(),
778778
proxy_required=proxy_req)
779779
else:
780+
config['params']['extra'] = {
781+
'proxy': getfqdn(),
782+
'proxy_required': proxy_req,
783+
}
780784
group[resource_name] = export_cls(config)
781785
await self.update_resource(group_name, resource_name)
782786

0 commit comments

Comments
 (0)