Skip to content

Commit 8cb8ecd

Browse files
committed
remote/coordinator: show error reason for failed exporter commands
If an acquire or release failed on the exporter, we should add the reason to the exception. Signed-off-by: Jan Luebbe <[email protected]>
1 parent a1b12f7 commit 8cb8ecd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labgrid/remote/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ async def _acquire_resource(self, place, resource):
592592
self.get_exporter_by_name(resource.path[0]).queue.put_nowait(cmd)
593593
await cmd.wait()
594594
if not cmd.response.success:
595-
raise ExporterError("failed to acquire {resource}")
595+
raise ExporterError("failed to acquire {resource} ({cmd.response.reason})")
596596
if resource.acquired != place.name:
597597
logging.warning("resource %s not acquired by this place after acquire request", resource)
598598

@@ -648,7 +648,7 @@ async def _release_resources(self, place, resources, callback=True):
648648
self.get_exporter_by_name(resource.path[0]).queue.put_nowait(cmd)
649649
await cmd.wait()
650650
if not cmd.response.success:
651-
raise ExporterError(f"failed to release {resource}")
651+
raise ExporterError(f"failed to release {resource} ({cmd.response.reason})")
652652
if resource.acquired:
653653
logging.warning("resource %s still acquired after release request", resource)
654654
except (ExporterError, TimeoutError):

0 commit comments

Comments
 (0)