diff options
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 164bcea8..91d20a76 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -360,6 +360,7 @@ def get_cfg_by_path(yobj, keyp, default=None): def fixup_output(cfg, mode): (outfmt, errfmt) = get_output_cfg(cfg, mode) redirect_output(outfmt, errfmt) + return (outfmt, errfmt) # redirect_output(outfmt, errfmt, orig_out, orig_err) @@ -448,6 +449,16 @@ def obj_name(obj): return obj_name(obj.__class__) +def mergemanydict(srcs, reverse=False): + if reverse: + srcs = reversed(srcs) + m_cfg = {} + for a_cfg in srcs: + if a_cfg: + m_cfg = mergedict(m_cfg, a_cfg) + return m_cfg + + def mergedict(src, cand): """ Merge values from C{cand} into C{src}. |