af2e7fd73e
These filters can be used to capture a lot of the logic that we currently have in 'when' statements, about which services are enabled for a particular host. In order to use these filters, it is necessary to install the kolla_ansible python module, and not just the dependencies listed in requirements.txt. The CI test and quickstart install from source documentation has been updated accordingly. Ansible is not currently in OpenStack global requirements, so for unit tests we avoid a direct dependency on Ansible and provide fakes where necessary. Change-Id: Ib91cac3c28e2b5a834c9746b1d2236a309529556
25 lines
899 B
Python
25 lines
899 B
Python
# Copyright (c) 2019 StackHPC Ltd.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
try:
|
|
from ansible.errors import AnsibleFilterError
|
|
except ImportError:
|
|
# NOTE(mgoddard): For unit testing we don't depend on Ansible since it is
|
|
# not in global requirements.
|
|
AnsibleFilterError = Exception
|
|
|
|
|
|
class FilterError(AnsibleFilterError):
|
|
"""Error during execution of a jinja2 filter."""
|