salt.serializers.yaml
Implements YAML serializer.
Underneath, it is based on pyyaml and use the safe dumper and loader.
It also use C bindings if they are available.
-
salt.serializers.yaml.BaseDumper
alias of yaml.cyaml.CSafeDumper
-
salt.serializers.yaml.BaseLoader
alias of yaml.cyaml.CSafeLoader
-
exception salt.serializers.yaml.ConstructorError(context=None, context_mark=None, problem=None, problem_mark=None, note=None)
-
exception salt.serializers.yaml.DeserializationError(message, line_num=None, buf='', marker=' <======================', trace=None)
Raised when stream of string failed to be deserialized
-
class salt.serializers.yaml.Dumper(stream, default_style=None, default_flow_style=False, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None, sort_keys=True)
Overwrites Dumper as not for pollute legacy Dumper
-
yaml_multi_representers = {<class 'salt.serializers.yaml.EncryptedString'>: <function EncryptedString.yaml_dumper at 0x6998060>, <class 'NoneType'>: <function SafeRepresenter.represent_none at 0x4778de0>, <class 'str'>: <function SafeRepresenter.represent_str at 0x4778e80>, <class 'bool'>: <function SafeRepresenter.represent_bool at 0x4778fc0>, <class 'int'>: <function SafeRepresenter.represent_int at 0x4779060>, <class 'float'>: <function SafeRepresenter.represent_float at 0x4779180>, <class 'list'>: <function SafeRepresenter.represent_list at 0x4779220>, <class 'tuple'>: <function SafeRepresenter.represent_list at 0x4779220>, <class 'dict'>: <function SafeRepresenter.represent_dict at 0x47792c0>, <class 'set'>: <function SafeRepresenter.represent_set at 0x4779360>, <class 'datetime.date'>: <function SafeRepresenter.represent_date at 0x4779400>, <class 'datetime.datetime'>: <function SafeRepresenter.represent_datetime at 0x47794a0>, None: <function SafeRepresenter.represent_undefined at 0x47795e0>, <class 'salt.utils.odict.OrderedDict'>: <function SafeRepresenter.represent_dict at 0x47792c0>}
-
class salt.serializers.yaml.EncryptedString
-
static yaml_constructor(loader, tag, node)
-
static yaml_dumper(dumper, data)
-
yaml_tag = '!encrypted'
-
class salt.serializers.yaml.Loader(stream)
Overwrites Loader as not for pollute legacy Loader
-
yaml_multi_constructors = {'!encrypted': <function EncryptedString.yaml_constructor at 0x7383020>, 'tag:yaml.org,2002:binary': <function SafeConstructor.construct_yaml_binary at 0x494bef0>, 'tag:yaml.org,2002:bool': <function SafeConstructor.construct_yaml_bool at 0x494bd10>, 'tag:yaml.org,2002:float': <function SafeConstructor.construct_yaml_float at 0x494be50>, 'tag:yaml.org,2002:int': <function SafeConstructor.construct_yaml_int at 0x494bdb0>, 'tag:yaml.org,2002:map': <function SafeConstructor.construct_yaml_map at 0x481a620>, 'tag:yaml.org,2002:null': <function SafeConstructor.construct_yaml_null at 0x494bb40>, 'tag:yaml.org,2002:omap': <function SafeConstructor.construct_yaml_omap at 0x47502f0>, 'tag:yaml.org,2002:pairs': <function SafeConstructor.construct_yaml_pairs at 0x47512c0>, 'tag:yaml.org,2002:seq': <function SafeConstructor.construct_yaml_seq at 0x4818e60>, 'tag:yaml.org,2002:set': <function SafeConstructor.construct_yaml_set at 0x4819560>, 'tag:yaml.org,2002:str': <function SafeConstructor.construct_yaml_str at 0x4818dc0>, 'tag:yaml.org,2002:timestamp': <function SafeConstructor.construct_yaml_timestamp at 0x494c140>}
-
class salt.serializers.yaml.OrderedDict
-
exception salt.serializers.yaml.ScannerError(context=None, context_mark=None, problem=None, problem_mark=None, note=None)
-
exception salt.serializers.yaml.SerializationError(message='')
Raised when stream of string failed to be serialized
-
salt.serializers.yaml.deserialize(stream_or_string, **options)
Deserialize any string of stream like object into a Python data structure.
- Parameters
-
-
salt.serializers.yaml.serialize(obj, **options)
Serialize Python data to YAML.
- Parameters
-