summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2022-04-27 21:20:22 -0500
committerGitHub <noreply@github.com>2022-04-27 20:20:22 -0600
commit8a6be66156af57fb76211083d283ee104f2e9381 (patch)
tree528b07aee7b8fc8b3b01618b0aa4a05673899553 /cloudinit/util.py
parent729545c9aa43bf04a203b11c05c614bd1226532c (diff)
downloadcloud-init-git-8a6be66156af57fb76211083d283ee104f2e9381.tar.gz
Use cc_* module meta defintion over hardcoded vars (SC-888) (#1385)
Previously, each cc_* module required a hardcoded 'distro' and 'frequency' variable to control the respective distro to run on and run frequency. If undefined or invalid, we silently changed this to a default value. Instead, this commit will validate the MetaSchema definition and raise an exception if invalid. This means every module MUST contain a MetaSchema definition. Additionally, the Modules class was moved out of stages.py into its own module, along with some helper functions in config/__init__.py.
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 0e8f2f58..9fb0c661 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -821,10 +821,10 @@ def make_url(
return parse.urlunparse(pieces)
-def mergemanydict(srcs, reverse=False):
+def mergemanydict(srcs, reverse=False) -> dict:
if reverse:
srcs = reversed(srcs)
- merged_cfg = {}
+ merged_cfg: dict = {}
for cfg in srcs:
if cfg:
# Figure out which mergers to apply...