Improve error when exclusive resource allocation fails
This change uses resource_name instead of class_name ("ResourceAllocator") in error messages when exclusive resource allocation fails. Change-Id: I9b544292cd533c3bbc622dbd77faa1e1aac94395
This commit is contained in:
parent
36edd14d76
commit
93b7a2014a
|
@ -82,8 +82,8 @@ class ResourceAllocator(object):
|
|||
return resource
|
||||
|
||||
raise ValueError(
|
||||
'Could not allocate a new resource in %s from pool %s' %
|
||||
(self.__class__.__name__, allocations))
|
||||
'Could not allocate a new resource of type %s from pool %s' %
|
||||
(self._resource_name, allocations))
|
||||
|
||||
@utils.synchronized('resource_allocator', external=True, lock_path='/tmp')
|
||||
def release(self, resource):
|
||||
|
|
Loading…
Reference in New Issue