summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag Wieers <dag@wieers.com>2019-09-25 18:21:58 +0200
committerToshio Kuratomi <a.badger@gmail.com>2019-10-08 09:14:02 -0700
commitc2f528b7686c9573aa8493357219e0bbe4416dd3 (patch)
treebe3e439e38de45a58f317513dedcd1cd581d4657
parent537dcebbe4fb807e808fdb956a229f4c012503e3 (diff)
downloadansible-c2f528b7686c9573aa8493357219e0bbe4416dd3.tar.gz
Fix whitespace issue in filter (backport 2.7)
This fixes reported issue #60276 This is a backport of #62768
-rw-r--r--changelogs/fragments/aci-42-filter-whitespace.yaml2
-rw-r--r--lib/ansible/module_utils/network/aci/aci.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/changelogs/fragments/aci-42-filter-whitespace.yaml b/changelogs/fragments/aci-42-filter-whitespace.yaml
new file mode 100644
index 0000000000..389fbc9e2e
--- /dev/null
+++ b/changelogs/fragments/aci-42-filter-whitespace.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+- "ACI modules - Fix a whitespace issue in filters for ACI 4.2 strict validation"
diff --git a/lib/ansible/module_utils/network/aci/aci.py b/lib/ansible/module_utils/network/aci/aci.py
index 0e44fc45cf..947ebbcaab 100644
--- a/lib/ansible/module_utils/network/aci/aci.py
+++ b/lib/ansible/module_utils/network/aci/aci.py
@@ -400,9 +400,9 @@ class ACIModule(object):
''' Build an APIC filter based on obj_class and key-value pairs '''
accepted_params = dict((k, v) for (k, v) in params.items() if v is not None)
if len(accepted_params) == 1:
- return ','.join('eq({0}.{1}, "{2}")'.format(obj_class, k, v) for (k, v) in accepted_params.items())
+ return ','.join('eq({0}.{1},"{2}")'.format(obj_class, k, v) for (k, v) in accepted_params.items())
elif len(accepted_params) > 1:
- return 'and(' + ','.join(['eq({0}.{1}, "{2}")'.format(obj_class, k, v) for (k, v) in accepted_params.items()]) + ')'
+ return 'and(' + ','.join(['eq({0}.{1},"{2}")'.format(obj_class, k, v) for (k, v) in accepted_params.items()]) + ')'
def construct_url(self, root_class, subclass_1=None, subclass_2=None, subclass_3=None, child_classes=None):
"""