From c0c2960e175b6881219d3ba86c93c10340a03dea Mon Sep 17 00:00:00 2001 From: Laur Ivan Date: Sun, 11 Dec 2022 00:39:24 +0100 Subject: [PATCH] fix: Shortcut redirect. --- galaxy.yml | 2 +- meta/runtime.yml | 10 ++++++++++ plugins/filter/files.py | 8 ++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 meta/runtime.yml diff --git a/galaxy.yml b/galaxy.yml index 92ba878..cce5244 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,7 +9,7 @@ namespace: laurivan name: plugins # The version of the collection. Must be compatible with semantic versioning -version: 1.0.1 +version: 1.0.2 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/meta/runtime.yml b/meta/runtime.yml new file mode 100644 index 0000000..b598174 --- /dev/null +++ b/meta/runtime.yml @@ -0,0 +1,10 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +requires_ansible: '>=2.9.6' +plugin_routing: + filter: + abspath: + redirect: laurivan.plugins.abspath \ No newline at end of file diff --git a/plugins/filter/files.py b/plugins/filter/files.py index 3f89a3b..1b008ec 100644 --- a/plugins/filter/files.py +++ b/plugins/filter/files.py @@ -1,9 +1,13 @@ from functools import partial from ansible.utils.unicode import unicode_wrap +def abspath(fname): + return os.path.abspath(fname) + class FilterModule(object): ''' Ansible file jinja2 filters ''' def filters(self): - return { - 'abspath': partial(unicode_wrap, os.path.abspath) + filters = { + 'abspath': abspath } + return filters