summaryrefslogtreecommitdiff
path: root/cloudinit/features.py
diff options
context:
space:
mode:
authorlucasmoura <lucas.moura@canonical.com>2020-06-30 19:25:26 -0300
committerGitHub <noreply@github.com>2020-06-30 16:25:26 -0600
commit3fcdacc8995d6908858aceaf1da7ee5ff090fc04 (patch)
tree5cebbbd7e891a65a6a6b33e9b76ccda862e05291 /cloudinit/features.py
parente88f15a3bca93c82eb02c13e87f2b6839385639b (diff)
downloadvyos-cloud-init-3fcdacc8995d6908858aceaf1da7ee5ff090fc04.tar.gz
vyos-cloud-init-3fcdacc8995d6908858aceaf1da7ee5ff090fc04.zip
Disable ec2 mirror for non aws instances (#390)
For versions before 20.2, we allowed the use of ec2 mirrors if the datasource availability_zone matches one of the ec2 regions. We are now updating that behavior to allow allow the use of ec2 mirrors on ec2 instances or if the user directly passes an an ec2 mirror url through #cloud-config apt directives. LP: #1456277
Diffstat (limited to 'cloudinit/features.py')
-rw-r--r--cloudinit/features.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/cloudinit/features.py b/cloudinit/features.py
index e455213d..c44fa29e 100644
--- a/cloudinit/features.py
+++ b/cloudinit/features.py
@@ -26,6 +26,17 @@ After the 20.2 release, we instead raise an exception.
This flag can be removed after Focal is no longer supported
"""
+
+ALLOW_EC2_MIRRORS_ON_NON_AWS_INSTANCE_TYPES = False
+"""
+When configuring apt mirrors, old behavior is to allow
+the use of ec2 mirrors if the datasource availability_zone format
+matches one of the possible aws ec2 regions. After the 20.2 release, we
+no longer publish ec2 region mirror urls on non-AWS cloud platforms.
+Besides feature_overrides.py, users can override this by providing
+#cloud-config apt directives.
+"""
+
try:
# pylint: disable=wildcard-import
from cloudinit.feature_overrides import * # noqa