summaryrefslogtreecommitdiff
path: root/cloudinit/config
diff options
context:
space:
mode:
authorBrett Holman <bholman.devel@gmail.com>2021-11-01 12:42:59 -0600
committerGitHub <noreply@github.com>2021-11-01 13:42:59 -0500
commitb1beb53886527eb787b504f374f24a7bd5fe06ac (patch)
treeeb0b7426115c3a4a880364d3d1650cc0b378e2d3 /cloudinit/config
parenta90d8338f07b30a46887f7c133baade63129a53a (diff)
downloadvyos-cloud-init-b1beb53886527eb787b504f374f24a7bd5fe06ac.tar.gz
vyos-cloud-init-b1beb53886527eb787b504f374f24a7bd5fe06ac.zip
Fix unhandled apt_configure case. (#1065)
Don't throw an exception when mirror arch is unspecified.
Diffstat (limited to 'cloudinit/config')
-rw-r--r--cloudinit/config/cc_apt_configure.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/cloudinit/config/cc_apt_configure.py b/cloudinit/config/cc_apt_configure.py
index c3c48bbd..86d0feae 100644
--- a/cloudinit/config/cc_apt_configure.py
+++ b/cloudinit/config/cc_apt_configure.py
@@ -36,14 +36,14 @@ frequency = PER_INSTANCE
distros = ["ubuntu", "debian"]
mirror_property = {
'type': 'array',
- 'item': {
+ 'items': {
'type': 'object',
'additionalProperties': False,
'required': ['arches'],
'properties': {
'arches': {
'type': 'array',
- 'item': {
+ 'items': {
'type': 'string'
},
'minItems': 1
@@ -54,7 +54,7 @@ mirror_property = {
},
'search': {
'type': 'array',
- 'item': {
+ 'items': {
'type': 'string',
'format': 'uri'
},
@@ -113,11 +113,12 @@ schema = {
search:
- 'http://cool.but-sometimes-unreachable.com/ubuntu'
- 'http://us.archive.ubuntu.com/ubuntu'
- search_dns: <true/false>
+ search_dns: false
- arches:
- s390x
- arm64
uri: 'http://archive-to-use-for-arm64.example.com/ubuntu'
+
security:
- arches:
- default
@@ -260,7 +261,8 @@ schema = {
``http://archive.ubuntu.com/ubuntu``.
- ``security`` => \
``http://security.ubuntu.com/ubuntu``
- """)},
+ """)
+ },
'security': {
**mirror_property,
'description': dedent("""\
@@ -380,6 +382,7 @@ schema = {
- ``key``: a raw PGP key.
- ``keyserver``: alternate keyserver to pull \
``keyid`` key from.
+ - ``filename``: specify the name of the .list file
The ``source`` key supports variable
replacements for the following strings:
@@ -1040,7 +1043,7 @@ def get_arch_mirrorconfig(cfg, mirrortype, arch):
# select the specification matching the target arch
default = None
for mirror_cfg_elem in mirror_cfg_list:
- arches = mirror_cfg_elem.get("arches", [])
+ arches = mirror_cfg_elem.get("arches") or []
if arch in arches:
return mirror_cfg_elem
if "default" in arches: