Skip to content

exporter of a resource not started deserves a meaningful error message #149

@saschahauer

Description

@saschahauer

Situation: A host exports a resource, a serial connection in this case, but the exporter is not started.
When trying to connect to this resource a meaningful error message should be printed. Instead, this
backtrace is printed:

sha-phycore-imx6sha@dude:~ labgrid-client console
Traceback (most recent call last):
  File "/opt/venv/python3.5-x86_64/lib/python3.5/site-packages/labgrid/remote/client.py", line 893, in main
    args.func(session)
  File "/opt/venv/python3.5-x86_64/lib/python3.5/site-packages/labgrid/remote/client.py", line 596, in console
    res = self._console(place)
  File "/opt/venv/python3.5-x86_64/lib/python3.5/site-packages/labgrid/remote/client.py", line 574, in _console
    resource = target.get_resource(NetworkSerialPort)
  File "/opt/venv/python3.5-x86_64/lib/python3.5/site-packages/labgrid/target.py", line 83, in get_resource
    "no resource matching {} found in target {}".format(cls, self)
labgrid.exceptions.NoResourceFoundError: no resource matching <class 'labgrid.resource.serialport.NetworkSerialPort'> found in target Target(name='sha-phycore-imx6', env=Environment(config_file='/opt/bin/labgrid.yaml'))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions