labgrid-project / labgrid

Embedded systems control library for development, testing and installation
https://labgrid.readthedocs.io/
Other
332 stars 174 forks source link

Info Driver find multiple matching drivers #138

Closed jonau closed 6 years ago

jonau commented 7 years ago

If I provide an info driver in my environment it raises an the error:

labgrid.exceptions.NoDriverFoundError: multiple drivers matching <class 'labgrid.protocol.commandprotocol.CommandProtocol'> found in target Target(name='main', env=Environment(config_file='env.yaml'))

This is due to the fact, that I have an SSH-Driver, an Barebox-Driver and an Serial Connection to the Target defined in the environment. I suppose #124 will solve the problem, as we than can select the right driver.

I also saw the TODO in the source of InfoDriver.

# TODO: rework CommandProtocol binding to select correct underlying driver
# (No UBoot/BareboxDriver, SSH > Serial,…)

Do you have a specific plan for that?

Emantor commented 7 years ago

A test of #124 would be greatly appreciated, although the documentation for the new selection is still missing.

Regarding the priorities: Yes we have, the current idea is to implement priorities in the bindings via integers. A driver can explicitly assign a priority to a supplier and thus get the best matching result. There is no code available yet though.

Emantor commented 6 years ago

We merged multiple driver support since then and priorities are coming up soon, i'll close this for now. Don't hesitate to reopen if something comes up on your side.