Fix invalid src option return response for network config modules (#56076)

*  Add changed key in faliure case to maintain backward compatibility

(cherry picked from commit 1a66121f03)
This commit is contained in:
Ganesh Nalawade 2019-05-04 07:23:12 -04:00 committed by Matt Clay
parent e925dd7713
commit 457efa8136
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- Fix invalid src option return response for network config modules (https://github.com/ansible/ansible/pull/56076)

View file

@ -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)