mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-21 20:38:57 +00:00
ResourceResolver: Show version number when resource wasn't found.
If the ResourceResolver was looking for a specific version of a resource and could not find it, this version number is now shown in the error message.
This commit is contained in:
parent
a2257fe1e2
commit
12dfbef76b
@ -69,7 +69,11 @@ class ResourceResolver(object):
|
|||||||
self.logger.debug('\t{}'.format(result))
|
self.logger.debug('\t{}'.format(result))
|
||||||
return result
|
return result
|
||||||
if strict:
|
if strict:
|
||||||
raise ResourceError('{} could not be found'.format(resource))
|
if kwargs:
|
||||||
|
criteria = ', '.join(['{}:{}'.format(k, v) for k, v in kwargs.iteritems()])
|
||||||
|
raise ResourceError('{} ({}) could not be found'.format(resource, criteria))
|
||||||
|
else:
|
||||||
|
raise ResourceError('{} could not be found'.format(resource))
|
||||||
self.logger.debug('Resource {} not found.'.format(resource))
|
self.logger.debug('Resource {} not found.'.format(resource))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user