From 107c13759edf03adc0fdad4787b0aedbd75f0488 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Wed, 22 Jun 2016 09:22:50 -0500 Subject: [PATCH] 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 --- lib/ansible/module_utils/network.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/ansible/module_utils/network.py b/lib/ansible/module_utils/network.py index 19c0c2c5320..fbca8f05b0b 100644 --- a/lib/ansible/module_utils/network.py +++ b/lib/ansible/module_utils/network.py @@ -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__)