We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When creating an env config with wrong SerialDriver bindings, a completely unrelated error happens:
$ labgrid-client con Selected role main from configuration file Traceback (most recent call last): File "labgrid/labgrid/remote/client.py", line 1934, in main target = session._get_target(place) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/remote/client.py", line 671, in _get_target target = self.env.get_target(self.role) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/environment.py", line 49, in get_target target = target_factory.make_target(role, config, env=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/factory.py", line 159, in make_target self.make_driver(target, driver, name, args) File "labgrid/labgrid/factory.py", line 138, in make_driver d = cls(target, name, **args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "<attrs generated init labgrid.driver.serialdriver.SerialDriver>", line 11, in __init__ self.__attrs_post_init__() File "labgrid/labgrid/driver/serialdriver.py", line 26, in __attrs_post_init__ super().__attrs_post_init__() File "labgrid/labgrid/driver/consoleexpectmixin.py", line 18, in __attrs_post_init__ super().__attrs_post_init__() File "labgrid/labgrid/driver/common.py", line 25, in __attrs_post_init__ super().__attrs_post_init__() File "labgrid/labgrid/binding.py", line 55, in __attrs_post_init__ target.bind(self) File "labgrid/labgrid/target.py", line 430, in bind return self.bind_driver(bindable) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/target.py", line 406, in bind_driver f"{client} got unexpected bindings: {list(mapping.keys())}" ^^^^^^^^ File "labgrid/labgrid/driver/serialdriver.py", line 116, in __str__ return f"SerialDriver({self.target.name})" ^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'name'
When dropping SerialDriver's __str___() the actual error cause is shown:
__str___()
$ labgrid-client con Selected role main from configuration file Traceback (most recent call last): File "labgrid/labgrid/remote/client.py", line 1934, in main target = session._get_target(place) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/remote/client.py", line 671, in _get_target target = self.env.get_target(self.role) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/environment.py", line 49, in get_target target = target_factory.make_target(role, config, env=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/factory.py", line 159, in make_target self.make_driver(target, driver, name, args) File "labgrid/labgrid/factory.py", line 138, in make_driver d = cls(target, name, **args) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "<attrs generated init labgrid.driver.serialdriver.SerialDriver>", line 11, in __init__ self.__attrs_post_init__() File "labgrid/labgrid/driver/serialdriver.py", line 26, in __attrs_post_init__ super().__attrs_post_init__() File "labgrid/labgrid/driver/consoleexpectmixin.py", line 18, in __attrs_post_init__ super().__attrs_post_init__() File "labgrid/labgrid/driver/common.py", line 25, in __attrs_post_init__ super().__attrs_post_init__() File "labgrid/labgrid/binding.py", line 55, in __attrs_post_init__ target.bind(self) File "labgrid/labgrid/target.py", line 430, in bind return self.bind_driver(bindable) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "labgrid/labgrid/target.py", line 405, in bind_driver raise BindingError( labgrid.binding.BindingError: SerialDriver() got unexpected bindings: ['serial']
This happens because the target checks if the driver (called client here) consumed all bindings before setting itself to client.target:
client.target
labgrid/labgrid/target.py
Lines 403 to 418 in 9e0562e
If that check fails, the driver's __str__() is called. In the case of the SerialDriver, self.target.name is used in this method.
__str__()
self.target.name
I am not really sure what's the correct fix. Setting client.target = self earlier? I am unsure about the implications.
client.target = self
The text was updated successfully, but these errors were encountered:
IMO we should fix the __str__ call sites as there are only two.
__str__
Sorry, something went wrong.
No branches or pull requests
When creating an env config with wrong SerialDriver bindings, a completely unrelated error happens:
When dropping SerialDriver's
__str___()
the actual error cause is shown:This happens because the target checks if the driver (called client here) consumed all bindings before setting itself to
client.target
:labgrid/labgrid/target.py
Lines 403 to 418 in 9e0562e
If that check fails, the driver's
__str__()
is called. In the case of the SerialDriver,self.target.name
is used in this method.I am not really sure what's the correct fix. Setting
client.target = self
earlier? I am unsure about the implications.The text was updated successfully, but these errors were encountered: