def build_values(name, values_mods):
values_file = os.path.join(name, '<STR_LIT>')<EOL>with open(values_file) as f:<EOL><INDENT>values = yaml.load(f)<EOL><DEDENT>for key, value in values_mods.items():<EOL><INDENT>parts = key.split('<STR_LIT:.>')<EOL>mod_obj = values<EOL>for p in parts:<EOL><INDENT>mod_obj = mod_obj[p]<EOL><DEDENT>print(f"<STR_LIT>")<EOL>if isinstance(mod_obj, MutableMapping):<EOL><INDENT>keys = IMAGE_REPOSITORY_KEYS & mod_obj.keys()<EOL>if keys:<EOL><INDENT>for key in keys:<EOL><INDENT>mod_obj[key] = value['<STR_LIT>']<EOL><DEDENT><DEDENT>else:<EOL><INDENT>possible_keys = '<STR_LIT>'.join(IMAGE_REPOSITORY_KEYS)<EOL>raise KeyError(<EOL>f'<STR_LIT>'<EOL>)<EOL><DEDENT>mod_obj['<STR_LIT>'] = value['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(<EOL>f'<STR_LIT>'<EOL>)<EOL><DEDENT><DEDENT>with open(values_file, '<STR_LIT:w>') as f:<EOL><INDENT>yaml.dump(values, f)<EOL><DEDENT>
Update name/values.yaml with modifications