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:
Cedric Brandily 2016-03-31 14:39:53 +02:00
parent 36edd14d76
commit 93b7a2014a
1 changed files with 2 additions and 2 deletions

View File

@ -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):