From 6f40bab20fb8f28cfb0ebd7f092646edabfa84df Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 9 Dec 2015 12:07:36 -0800 Subject: [PATCH] Simplify code --- lib/ansible/modules/extras/cloud/lxc/lxc_container.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/cloud/lxc/lxc_container.py b/lib/ansible/modules/extras/cloud/lxc/lxc_container.py index adb9637acf..fd5daf1c47 100644 --- a/lib/ansible/modules/extras/cloud/lxc/lxc_container.py +++ b/lib/ansible/modules/extras/cloud/lxc/lxc_container.py @@ -637,9 +637,10 @@ class LxcContainerManagement(object): variables.pop(v, None) return_dict = dict() + false_values = [None, ''] + BOOLEANS_FALSE for k, v in variables.items(): _var = self.module.params.get(k) - if not [i for i in [None, ''] + BOOLEANS_FALSE if i == _var]: + if _var not in false_values: return_dict[v] = _var else: return return_dict