Fix whitespace issue in filter (backport 2.9)

This fixes reported issue #60276

This is a backport of #62768
pull/64281/head
Dag Wieers 5 years ago committed by Toshio Kuratomi
parent bdaa8baacb
commit 9fd70e3f3c

@ -0,0 +1,2 @@
bugfixes:
- "ACI modules - Fix a whitespace issue in filters for ACI 4.2 strict validation"

@ -409,9 +409,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 _deep_url_path_builder(self, obj):
target_class = obj['target_class']

Loading…
Cancel
Save