mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
Add filter module base, prepare adding filters (#553)
* Improve string handling. * Cleanup tests. * Add filter module mock.
This commit is contained in:
22
plugins/plugin_utils/filter_module.py
Normal file
22
plugins/plugin_utils/filter_module.py
Normal file
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2022 Felix Fontein <felix@fontein.de>
|
||||
# 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
|
||||
|
||||
# NOTE: THIS IS ONLY FOR FILTER PLUGINS!
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
|
||||
from ansible.errors import AnsibleFilterError
|
||||
|
||||
|
||||
class FilterModuleMock(object):
|
||||
def __init__(self, params):
|
||||
self.check_mode = True
|
||||
self.params = params
|
||||
self._diff = False
|
||||
|
||||
def fail_json(self, msg, **kwargs):
|
||||
raise AnsibleFilterError(msg)
|
||||
Reference in New Issue
Block a user