Skip to content

Commit 2053716

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 d69c3a9 commit 2053716

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
@@ -660,7 +660,7 @@ async def _acquire_resource(self, place, resource):
660660
except asyncio.TimeoutError as e:
661661
raise ExporterError("timed out waiting for exporter while acquiring resource") from e
662662
if not cmd.response.success:
663-
raise ExporterError(f"failed to acquire {resource} ({cmd.response.reason})")
663+
raise ExporterError(cmd.response.reason or "exporter returned failure without a reason")
664664
if resource.acquired != place.name:
665665
logging.warning("resource %s not acquired by this place after acquire request", resource)
666666

@@ -735,7 +735,7 @@ async def _release_resources(self, place, resources, callback=True):
735735
except asyncio.TimeoutError as e:
736736
raise ExporterError("timed out waiting for exporter while releasing resource") from e
737737
if not cmd.response.success:
738-
raise ExporterError(f"failed to release {resource} ({cmd.response.reason})")
738+
raise ExporterError(cmd.response.reason or "exporter returned failure without a reason")
739739
if resource.acquired:
740740
logging.warning("resource %s still acquired after release request", resource)
741741
except ExporterError as e:

0 commit comments

Comments
 (0)