From 16d627427676cc80df530ef9faf0524227dfc4b2 Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 12 Sep 2016 09:59:43 -0400 Subject: [PATCH] raise exception when src file is not found in net_config This will now raise an exception if the file path specified in src is not found and the module will gracefully error. ref #4797 --- lib/ansible/plugins/action/net_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/net_config.py b/lib/ansible/plugins/action/net_config.py index 5cb3e646b9b..489f872ffb0 100644 --- a/lib/ansible/plugins/action/net_config.py +++ b/lib/ansible/plugins/action/net_config.py @@ -95,7 +95,7 @@ class ActionModule(ActionBase): source = self._loader.path_dwim_relative(working_path, src) if not os.path.exists(source): - return + raise ValueError('path specified in src not found') try: with open(source, 'r') as f: