Skip to content

Commit 360ec1a

Browse files
alexterceteidan-arm
authored andcommitted
remote/coordinator: reduce exporter failure details
Avoid including the full resource representation in exporter acquire/release failure messages returned to the client. The exporter-provided reason is enough for users, while the full resource details can be noisy and may expose more information than needed. Signed-off-by: Alex Tercete <alex.tercete@arm.com> Reviewed-by: Alex Tercete <alex.tercete@arm.com> # gatekeeper Co-authored-by: Idan Saadon <idan.saadon@arm.com>
1 parent 4ba3d9c commit 360ec1a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

labgrid/remote/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ async def _acquire_resource(self, place, resource):
689689
except asyncio.TimeoutError as e:
690690
raise ExporterError("timed out waiting for exporter while acquiring resource") from e
691691
if not cmd.response.success:
692-
raise ExporterError(f"failed to acquire {resource} ({cmd.response.reason})")
692+
raise ExporterError(cmd.response.reason or "exporter returned failure without a reason")
693693
if resource.acquired != place.name:
694694
logging.warning("resource %s not acquired by this place after acquire request", resource)
695695

@@ -789,7 +789,7 @@ async def _release_resources(self, place, resources, callback=True):
789789
except asyncio.TimeoutError as e:
790790
raise ExporterError("timed out waiting for exporter while releasing resource") from e
791791
if not cmd.response.success:
792-
raise ExporterError(f"failed to release {resource} ({cmd.response.reason})")
792+
raise ExporterError(cmd.response.reason or "exporter returned failure without a reason")
793793
if resource.acquired:
794794
logging.warning("resource %s still acquired after release request", resource)
795795
except ExporterError as e:

0 commit comments

Comments
 (0)