def serialize_yaml_tofile ( filename , resource ) : stream = file ( filename , "w" ) yaml . dump ( resource , stream , default_flow_style = False )
python yaml writ to json like file
Serializes a K8S resource to YAML - formatted file .
def serialize_yaml_tofile(filename, resource):
    """
    Serializes a K8S resource to YAML-formatted file.
    """
    stream = file(filename, "w")
    yaml.dump(resource, stream, default_flow_style=False)