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
changes/03/299903/1
Cedric Brandily 7 years ago
parent 36edd14d76
commit 93b7a2014a
  1. 4
      neutron/tests/common/exclusive_resources/resource_allocator.py

@ -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…
Cancel
Save