Blame cloudinit/features.py

Packit Service 751c4a
# This file is part of cloud-init. See LICENSE file for license information.
Packit Service 751c4a
"""
Packit Service 751c4a
Feature flags are used as a way to easily toggle configuration
Packit Service 751c4a
**at build time**. They are provided to accommodate feature deprecation and
Packit Service 751c4a
downstream configuration changes.
Packit Service 751c4a
Packit Service 751c4a
Currently used upstream values for feature flags are set in
Packit Service 751c4a
``cloudinit/features.py``. Overrides to these values (typically via quilt
Packit Service 751c4a
patch) can be placed
Packit Service 751c4a
in a file called ``feature_overrides.py`` in the same directory. Any value
Packit Service 751c4a
set in ``feature_overrides.py`` will override the original value set
Packit Service 751c4a
in ``features.py``.
Packit Service 751c4a
Packit Service 751c4a
Each flag should include a short comment regarding the reason for
Packit Service 751c4a
the flag and intended lifetime.
Packit Service 751c4a
Packit Service 751c4a
Tests are required for new feature flags, and tests must verify
Packit Service 751c4a
all valid states of a flag, not just the default state.
Packit Service 751c4a
"""
Packit Service 751c4a
Packit Service 751c4a
ERROR_ON_USER_DATA_FAILURE = True
Packit Service 751c4a
"""
Packit Service 751c4a
If there is a failure in obtaining user data (i.e., #include or
Packit Service 751c4a
decompress fails), old behavior is to log a warning and proceed.
Packit Service 751c4a
After the 20.2 release, we instead raise an exception.
Packit Service 751c4a
This flag can be removed after Focal is no longer supported
Packit Service 751c4a
"""
Packit Service 751c4a
Packit Service 751c4a
Packit Service 751c4a
ALLOW_EC2_MIRRORS_ON_NON_AWS_INSTANCE_TYPES = False
Packit Service 751c4a
"""
Packit Service 751c4a
When configuring apt mirrors, old behavior is to allow
Packit Service 751c4a
the use of ec2 mirrors if the datasource availability_zone format
Packit Service 751c4a
matches one of the possible aws ec2 regions. After the 20.2 release, we
Packit Service 751c4a
no longer publish ec2 region mirror urls on non-AWS cloud platforms.
Packit Service 751c4a
Besides feature_overrides.py, users can override this by providing
Packit Service 751c4a
#cloud-config apt directives.
Packit Service 751c4a
"""
Packit Service 751c4a
Packit Service 751c4a
try:
Packit Service 751c4a
    # pylint: disable=wildcard-import
Packit Service 751c4a
    from cloudinit.feature_overrides import *  # noqa
Packit Service 751c4a
except ImportError:
Packit Service 751c4a
    pass