ansible.parsing.yaml package

Submodules

ansible.parsing.yaml.constructor module

class ansible.parsing.yaml.constructor.AnsibleConstructor(file_name=None)[source]

Bases: yaml.constructor.Constructor

construct_yaml_map(node)[source]
construct_mapping(node, deep=False)[source]
construct_yaml_str(node, unsafe=False)[source]
construct_yaml_seq(node)[source]
construct_yaml_unsafe(node)[source]
yaml_constructors = {u'tag:yaml.org,2002:omap': <unbound method SafeConstructor.construct_yaml_omap>, u'tag:yaml.org,2002:python/dict': <unbound method AnsibleConstructor.construct_yaml_map>, u'tag:yaml.org,2002:python/complex': <unbound method Constructor.construct_python_complex>, u'tag:yaml.org,2002:seq': <unbound method AnsibleConstructor.construct_yaml_seq>, u'tag:yaml.org,2002:set': <unbound method SafeConstructor.construct_yaml_set>, u'tag:yaml.org,2002:python/float': <unbound method Constructor.construct_yaml_float>, u'tag:yaml.org,2002:python/long': <unbound method Constructor.construct_python_long>, u'tag:yaml.org,2002:pairs': <unbound method SafeConstructor.construct_yaml_pairs>, u'tag:yaml.org,2002:bool': <unbound method SafeConstructor.construct_yaml_bool>, u'tag:yaml.org,2002:timestamp': <unbound method SafeConstructor.construct_yaml_timestamp>, u'tag:yaml.org,2002:python/none': <unbound method Constructor.construct_yaml_null>, u'tag:yaml.org,2002:python/str': <unbound method Constructor.construct_python_str>, u'tag:yaml.org,2002:null': <unbound method SafeConstructor.construct_yaml_null>, u'!unsafe': <unbound method AnsibleConstructor.construct_yaml_unsafe>, u'tag:yaml.org,2002:python/int': <unbound method Constructor.construct_yaml_int>, u'tag:yaml.org,2002:float': <unbound method SafeConstructor.construct_yaml_float>, u'tag:yaml.org,2002:python/bool': <unbound method Constructor.construct_yaml_bool>, u'tag:yaml.org,2002:map': <unbound method AnsibleConstructor.construct_yaml_map>, u'tag:yaml.org,2002:python/list': <unbound method Constructor.construct_yaml_seq>, u'tag:yaml.org,2002:python/tuple': <unbound method Constructor.construct_python_tuple>, u'tag:yaml.org,2002:str': <unbound method AnsibleConstructor.construct_yaml_str>, u'tag:yaml.org,2002:int': <unbound method SafeConstructor.construct_yaml_int>, u'tag:yaml.org,2002:binary': <unbound method SafeConstructor.construct_yaml_binary>, u'tag:yaml.org,2002:python/unicode': <unbound method AnsibleConstructor.construct_yaml_str>, None: <unbound method SafeConstructor.construct_undefined>}

ansible.parsing.yaml.dumper module

class ansible.parsing.yaml.dumper.AnsibleDumper(stream, default_style=None, default_flow_style=None, canonical=None, indent=None, width=None, allow_unicode=None, line_break=None, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None)[source]

Bases: yaml.dumper.SafeDumper

A simple stub class that allows us to add representers for our overridden object types.

yaml_representers = {<class 'ansible.vars.hostvars.HostVars'>: <function represent_hostvars at 0x102b387d0>, <class 'ansible.parsing.yaml.objects.AnsibleMapping'>: <unbound method SafeRepresenter.represent_dict>, <class 'ansible.parsing.yaml.objects.AnsibleSequence'>: <unbound method SafeRepresenter.represent_list>, <type 'dict'>: <unbound method SafeRepresenter.represent_dict>, <type 'datetime.datetime'>: <unbound method SafeRepresenter.represent_datetime>, <type 'long'>: <unbound method SafeRepresenter.represent_long>, <type 'datetime.date'>: <unbound method SafeRepresenter.represent_date>, <type 'list'>: <unbound method SafeRepresenter.represent_list>, <type 'str'>: <unbound method SafeRepresenter.represent_str>, <type 'int'>: <unbound method SafeRepresenter.represent_int>, <type 'unicode'>: <unbound method SafeRepresenter.represent_unicode>, <type 'NoneType'>: <unbound method SafeRepresenter.represent_none>, <type 'bool'>: <unbound method SafeRepresenter.represent_bool>, <class 'ansible.parsing.yaml.objects.AnsibleUnicode'>: <unbound method SafeRepresenter.represent_unicode>, <type 'float'>: <unbound method SafeRepresenter.represent_float>, <type 'tuple'>: <unbound method SafeRepresenter.represent_list>, None: <unbound method SafeRepresenter.represent_undefined>, <type 'set'>: <unbound method SafeRepresenter.represent_set>}
ansible.parsing.yaml.dumper.represent_hostvars(self, data)[source]

ansible.parsing.yaml.loader module

class ansible.parsing.yaml.loader.AnsibleLoader(stream, file_name=None)[source]

Bases: _yaml.CParser, ansible.parsing.yaml.constructor.AnsibleConstructor, yaml.resolver.Resolver

ansible.parsing.yaml.objects module

class ansible.parsing.yaml.objects.AnsibleBaseYAMLObject[source]

Bases: object

the base class used to sub-class python built-in objects so that we can add attributes to them during yaml parsing

ansible_pos
class ansible.parsing.yaml.objects.AnsibleMapping[source]

Bases: ansible.parsing.yaml.objects.AnsibleBaseYAMLObject, dict

sub class for dictionaries

class ansible.parsing.yaml.objects.AnsibleUnicode[source]

Bases: ansible.parsing.yaml.objects.AnsibleBaseYAMLObject, unicode

sub class for unicode objects

class ansible.parsing.yaml.objects.AnsibleSequence[source]

Bases: ansible.parsing.yaml.objects.AnsibleBaseYAMLObject, list

sub class for lists