From 1a66121f0319793f05e969b94b4642e6475e6462 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Sat, 4 May 2019 07:23:12 -0400 Subject: [PATCH] Fix invalid src option return response for network config modules (#56076) * Add changed key in faliure case to maintain backward compatibility --- lib/ansible/plugins/action/network.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/network.py b/lib/ansible/plugins/action/network.py index d7b8a61f42..277dc70895 100644 --- a/lib/ansible/plugins/action/network.py +++ b/lib/ansible/plugins/action/network.py @@ -40,7 +40,10 @@ class ActionModule(_ActionModule): def run(self, task_vars=None): config_module = hasattr(self, '_config_module') and self._config_module if config_module and self._task.args.get('src'): - self._handle_src_option() + try: + self._handle_src_option() + except AnsibleError as e: + return {'failed': True, 'msg': e.message, 'changed': False} result = super(ActionModule, self).run(task_vars=task_vars)