fix all modules to be able to get parameter with value false (very important fix) (#65040)

* add import of future and __metaclass__

* fix all modules to be able to get parameter with value false (very importent fix)

* Update ignore.txt
This commit is contained in:
chkp-orso 2019-11-20 07:39:40 +01:00 committed by Sumit Jaiswal
parent bc92170242
commit b1e6667664
5 changed files with 10 additions and 7 deletions

View file

@ -73,7 +73,7 @@ def get_payload_from_parameters(params):
payload = {}
for parameter in params:
parameter_value = params[parameter]
if parameter_value and is_checkpoint_param(parameter):
if parameter_value is not None and is_checkpoint_param(parameter):
if isinstance(parameter_value, dict):
payload[parameter.replace("_", "-")] = get_payload_from_parameters(parameter_value)
elif isinstance(parameter_value, list) and len(parameter_value) != 0 and isinstance(parameter_value[0], dict):

View file

@ -3,6 +3,9 @@
# Copyright: (c) 2019, Or Soffer <orso@checkpoint.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):

View file

@ -3,6 +3,9 @@
# Copyright: (c) 2019, Or Soffer <orso@checkpoint.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
class ModuleDocFragment(object):

View file

@ -5111,10 +5111,6 @@ lib/ansible/plugins/doc_fragments/backup.py future-import-boilerplate
lib/ansible/plugins/doc_fragments/backup.py metaclass-boilerplate
lib/ansible/plugins/doc_fragments/ce.py future-import-boilerplate
lib/ansible/plugins/doc_fragments/ce.py metaclass-boilerplate
lib/ansible/plugins/doc_fragments/checkpoint_commands.py future-import-boilerplate
lib/ansible/plugins/doc_fragments/checkpoint_commands.py metaclass-boilerplate
lib/ansible/plugins/doc_fragments/checkpoint_objects.py future-import-boilerplate
lib/ansible/plugins/doc_fragments/checkpoint_objects.py metaclass-boilerplate
lib/ansible/plugins/doc_fragments/cnos.py future-import-boilerplate
lib/ansible/plugins/doc_fragments/cnos.py metaclass-boilerplate
lib/ansible/plugins/doc_fragments/constructed.py future-import-boilerplate
@ -5886,8 +5882,6 @@ test/units/playbook/test_conditional.py future-import-boilerplate
test/units/playbook/test_conditional.py metaclass-boilerplate
test/units/plugins/action/test_synchronize.py future-import-boilerplate
test/units/plugins/action/test_synchronize.py metaclass-boilerplate
test/units/plugins/httpapi/test_checkpoint.py future-import-boilerplate
test/units/plugins/httpapi/test_checkpoint.py metaclass-boilerplate
test/units/plugins/httpapi/test_ftd.py future-import-boilerplate
test/units/plugins/httpapi/test_ftd.py metaclass-boilerplate
test/units/plugins/inventory/test_constructed.py future-import-boilerplate

View file

@ -1,6 +1,9 @@
# (c) 2018 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.module_utils.six.moves.urllib.error import HTTPError