1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

changes Config class in network to only raise exceptions

The Config class should not call fail_json but simply raise exceptions
and allow the implementor to handle the exception
This commit is contained in:
Peter Sprygada 2016-06-22 09:22:50 -05:00
parent 7de23a1c5b
commit 107c13759e

View file

@ -116,11 +116,6 @@ class Config(object):
except AttributeError:
exc = get_exception()
raise NetworkError('undefined method "%s"' % method.__name__, exc=str(exc))
except NetworkError:
if raise_exc:
raise
exc = get_exception()
self.fail_json(msg=exc.message, **exc.kwargs)
except NotImplementedError:
raise NetworkError('method not supported "%s"' % method.__name__)