From 6f90d62be3f9d35dd0517f9ce3232c30866cc80c Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Thu, 6 Dec 2018 00:13:26 -0600 Subject: [PATCH] fix py3 scope for unique filter errors, enable filters integration tests on rhel8 beta (#48961) * fix py3 scope for unique filter errors, enable filters integration tests on rhel8 beta Signed-off-by: Adam Miller * add changelog Signed-off-by: Adam Miller --- changelogs/fragments/mathstuff-filter-py3-scope.yaml | 3 +++ lib/ansible/plugins/filter/mathstuff.py | 4 ++-- test/integration/targets/filters/aliases | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/mathstuff-filter-py3-scope.yaml diff --git a/changelogs/fragments/mathstuff-filter-py3-scope.yaml b/changelogs/fragments/mathstuff-filter-py3-scope.yaml new file mode 100644 index 00000000000..48cacc05d3b --- /dev/null +++ b/changelogs/fragments/mathstuff-filter-py3-scope.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - "mattstuff filter - fix py3 scope for unique filter errors" diff --git a/lib/ansible/plugins/filter/mathstuff.py b/lib/ansible/plugins/filter/mathstuff.py index 71cd85ad9c2..a0298a6494e 100644 --- a/lib/ansible/plugins/filter/mathstuff.py +++ b/lib/ansible/plugins/filter/mathstuff.py @@ -62,12 +62,12 @@ def unique(environment, a, case_sensitive=False, attribute=None): else: c = list(c) except TypeError as e: + error = e _do_fail(e) except Exception as e: + error = e _do_fail(e) display.warning('Falling back to Ansible unique filter as Jinja2 one failed: %s' % to_text(e)) - finally: - error = e if not HAS_UNIQUE or error: diff --git a/test/integration/targets/filters/aliases b/test/integration/targets/filters/aliases index c974298bab1..765b70da796 100644 --- a/test/integration/targets/filters/aliases +++ b/test/integration/targets/filters/aliases @@ -1,2 +1 @@ shippable/posix/group2 -skip/rhel8.0