To resolve the issue of handling exception for Nios lookup gracefully (#44254)

* to resolve 43705 (#44078)


(cherry picked from commit 6a395d8e24)

* adding changelog for backport

* adding new line
This commit is contained in:
Sumit Jaiswal 2018-09-05 04:11:03 +05:30 committed by Matt Clay
parent 6d3db56c2a
commit 300aefcad2
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,4 @@
---
bugfixes:
- To resolve the issue of handling exception for Nios lookup gracefully.
(https://github.com/ansible/ansible/pull/44078)

View file

@ -149,7 +149,11 @@ class WapiBase(object):
class WapiLookup(WapiBase):
''' Implements WapiBase for lookup plugins '''
pass
def handle_exception(self, method_name, exc):
if ('text' in exc.response):
raise Exception(exc.response['text'])
else:
raise Exception(exc)
class WapiInventory(WapiBase):