def WriteToYamlFile(yaml_file, change): """Writes the given change in yaml format to the given file. Args: yaml_file: file, File into which the change should be written. change: Change, Change to be written out. """ printer = resource_printer.YamlPrinter(yaml_file) printer.AddRecord(change)
def WriteEnvYaml(env, output_dir): """Writes the given environment values into the output_dir/env.yaml file. Args: env: {str: str}, Dictonary of environment values. output_dir: str, Path of directory to which env.yaml file should be written. """ env_file_path = os.path.join(output_dir, 'env.yaml') with files.Context(open(env_file_path, 'w')) as env_file: resource_printer.YamlPrinter(env_file).AddRecord(env)
def WriteToYamlFile(yaml_file, record_sets): """Writes the given record-sets in yaml format to the given file. Args: yaml_file: file, File into which the records should be written. record_sets: list, ResourceRecordSets to be written out. """ printer = resource_printer.YamlPrinter(yaml_file) for record_set in record_sets: printer.AddRecord(record_set)