Fix find_resource exception handling on numeric names with kwargs

The problem is in the way find_resource handle exception for the specific case
where name_or_id is an integer value.
The except should pass on type(ex).__name__ TypeError

This patch fix this bug
Closes-Bug: #1672806

Change-Id: Iee4cbd10c6414d6a3bb613c5992485a15764ef21
This commit is contained in:
Julien Lavesque
2017-03-15 00:18:46 +01:00
parent 62a17ed479
commit ce84378a28

View File

@@ -118,7 +118,8 @@ def find_resource(manager, name_or_id, **kwargs):
# of client exceptions. # of client exceptions.
except Exception as ex: except Exception as ex:
if (type(ex).__name__ == 'NotFound' or if (type(ex).__name__ == 'NotFound' or
type(ex).__name__ == 'HTTPNotFound'): type(ex).__name__ == 'HTTPNotFound' or
type(ex).__name__ == 'TypeError'):
pass pass
else: else:
raise raise