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

View File

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