From 93b7a2014a504d2eba6cb144cc532523037c1436 Mon Sep 17 00:00:00 2001 From: Cedric Brandily Date: Thu, 31 Mar 2016 14:39:53 +0200 Subject: [PATCH] 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 --- .../tests/common/exclusive_resources/resource_allocator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/tests/common/exclusive_resources/resource_allocator.py b/neutron/tests/common/exclusive_resources/resource_allocator.py index f84c7f17861..0944a224481 100644 --- a/neutron/tests/common/exclusive_resources/resource_allocator.py +++ b/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):