Skip to content

Commit 624667c

Browse files
remote/client: be more explicit about expected place acquired state in allow()/release_from()
Signed-off-by: Bastian Krause <[email protected]>
1 parent 4230591 commit 624667c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

labgrid/remote/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ async def release(self):
719719
async def release_from(self):
720720
"""Release a place, but only if acquired by a specific user"""
721721
place = self.get_place()
722+
if not place.acquired:
723+
raise UserError(f"place {place.name} is not acquired")
722724

723725
request = labgrid_coordinator_pb2.ReleasePlaceRequest(placename=place.name, fromuser=self.args.acquired)
724726

@@ -732,7 +734,7 @@ async def release_from(self):
732734

733735
async def allow(self):
734736
"""Allow another use access to a previously acquired place"""
735-
place = self.get_place()
737+
place = self.get_acquired_place()
736738
if "/" not in self.args.user:
737739
raise UserError(f"user {self.args.user} must be in <host>/<username> format")
738740
request = labgrid_coordinator_pb2.AllowPlaceRequest(placename=place.name, user=self.args.user)

0 commit comments

Comments
 (0)