Modify find_resource to support glanceclient HTTPNotFound exception.

In glanceclient, NotFound exception is encapsulated in HTTPNotFound.

Change-Id: I6d354b162aa0797b4f96431b38c1fe455dd026d7
This commit is contained in:
sunyajing 2016-06-21 13:32:26 +08:00
parent c34b11c26b
commit c2ffb0eb31
1 changed files with 2 additions and 1 deletions

View File

@ -100,7 +100,8 @@ def find_resource(manager, name_or_id, **kwargs):
# Eventually this should be pulled from a common set
# of client exceptions.
except Exception as ex:
if type(ex).__name__ == 'NotFound':
if (type(ex).__name__ == 'NotFound' or
type(ex).__name__ == 'HTTPNotFound'):
pass
else:
raise