def _UpdateAndVerifySubDict(base, updates, type_check):
  def fn(old, value):
    new = GetUpdatedParams(old, value)
    utils.ForceDictType(new, type_check)
    return new

  ret = copy.deepcopy(base)
  ret.update(dict((key, fn(base.get(key, {}), value))
                  for key, value in updates.items()))
  return ret
Updates and verifies a dict with sub dicts of the same type.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/common.py/_UpdateAndVerifySubDict