From 5cb0e00b7749f88855bf41e185e579c50df0c9db Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Mon, 26 Sep 2016 11:19:46 +0800 Subject: [PATCH] Fix merge_configs.py file when not provide vars parameter Use dict.pop(key, None) instead of del dict[key]. dict.pop will not raise any error when the key is not exist. TrivialFix Change-Id: I3808fc865afe6936a5d93eff792e1d1a93ba2085 --- ansible/action_plugins/merge_configs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/action_plugins/merge_configs.py b/ansible/action_plugins/merge_configs.py index 821b4877d5..dd4e382dbe 100644 --- a/ansible/action_plugins/merge_configs.py +++ b/ansible/action_plugins/merge_configs.py @@ -80,8 +80,8 @@ class ActionModule(action.ActionBase): fakefile.close() new_module_args = self._task.args.copy() - del new_module_args['vars'] - del new_module_args['sources'] + new_module_args.pop('vars', None) + new_module_args.pop('sources', None) new_module_args.update( dict(