From ef0851dcd4167d4135bfef2ff1ea46eaf182c816 Mon Sep 17 00:00:00 2001 From: Tzur Eliyahu Date: Mon, 13 May 2019 19:41:06 +0300 Subject: [PATCH] IBM_Storage: fixed a bug - Unwanted arguments cause failure (#56357) * IBM_Storage: fixed a bug which caused several of our modules to pass unwanted arguments and fail * IBM_Storage: Added a changelog for 56357 bug --- .../fragments/56357-ibm-storage-unwanted-args-cause-failure.yml | 2 ++ lib/ansible/module_utils/ibm_sa_utils.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/56357-ibm-storage-unwanted-args-cause-failure.yml diff --git a/changelogs/fragments/56357-ibm-storage-unwanted-args-cause-failure.yml b/changelogs/fragments/56357-ibm-storage-unwanted-args-cause-failure.yml new file mode 100644 index 0000000000..c8ee3e06f0 --- /dev/null +++ b/changelogs/fragments/56357-ibm-storage-unwanted-args-cause-failure.yml @@ -0,0 +1,2 @@ +bugfixes: +- ibm_storage - Added a check for null fields in ibm_storage utils module. diff --git a/lib/ansible/module_utils/ibm_sa_utils.py b/lib/ansible/module_utils/ibm_sa_utils.py index db02edb2e8..c3ab4103a9 100644 --- a/lib/ansible/module_utils/ibm_sa_utils.py +++ b/lib/ansible/module_utils/ibm_sa_utils.py @@ -81,6 +81,8 @@ def build_pyxcli_command(fields): """ Builds the args for pyxcli using the exact args from ansible""" pyxcli_args = {} for field in fields: + if not fields[field]: + continue if field in AVAILABLE_PYXCLI_FIELDS and fields[field] != '': pyxcli_args[field] = fields[field] return pyxcli_args