Merge "exclusive_resources: use set remove instead of discard"

This commit is contained in:
Jenkins 2017-04-12 11:25:58 +00:00 committed by Gerrit Code Review
commit 87cb9d8552
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class ResourceAllocator(object):
@utils.synchronized('resource_allocator', external=True, lock_path='/tmp')
def release(self, resource):
allocations = self._get_allocations()
allocations.discard(resource)
allocations.remove(resource)
if allocations:
self._write_allocations(allocations)
else: # Clean up the file if we're releasing the last allocation