heat.common.template_format module

heat.common.template_format.convert_json_to_yaml(json_str)[source]

Convert AWS JSON template format to Heat YAML format.

Parameters

json_str – a string containing the AWS JSON template format.

Returns

the equivalent string containing the Heat YAML format.

heat.common.template_format.parse(tmpl_str, tmpl_url=None)[source]

Takes a string and returns a dict containing the parsed structure.

This includes determination of whether the string is using the JSON or YAML format.

heat.common.template_format.simple_parse(tmpl_str, tmpl_url=None)[source]
heat.common.template_format.validate_template_limit(contain_str)[source]

Validate limit for the template.

Check if the contain exceeds allowed size range.

class heat.common.template_format.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)[source]

Bases: yaml.cyaml.CSafeDumper

represent_ordered_dict(data)[source]
yaml_representers = {<class 'NoneType'>: <function SafeRepresenter.represent_none>, <class 'str'>: <function SafeRepresenter.represent_str>, <class 'bytes'>: <function SafeRepresenter.represent_binary>, <class 'bool'>: <function SafeRepresenter.represent_bool>, <class 'int'>: <function SafeRepresenter.represent_int>, <class 'float'>: <function SafeRepresenter.represent_float>, <class 'list'>: <function SafeRepresenter.represent_list>, <class 'tuple'>: <function SafeRepresenter.represent_list>, <class 'dict'>: <function SafeRepresenter.represent_dict>, <class 'set'>: <function SafeRepresenter.represent_set>, <class 'datetime.date'>: <function SafeRepresenter.represent_date>, <class 'datetime.datetime'>: <function SafeRepresenter.represent_datetime>, None: <function SafeRepresenter.represent_undefined>, <class 'collections.OrderedDict'>: <function yaml_dumper.represent_ordered_dict>}
class heat.common.template_format.yaml_loader(stream)[source]

Bases: yaml.cyaml.CSafeLoader

yaml_constructors = {'tag:yaml.org,2002:null': <function SafeConstructor.construct_yaml_null>, 'tag:yaml.org,2002:bool': <function SafeConstructor.construct_yaml_bool>, 'tag:yaml.org,2002:int': <function SafeConstructor.construct_yaml_int>, 'tag:yaml.org,2002:float': <function SafeConstructor.construct_yaml_float>, 'tag:yaml.org,2002:binary': <function SafeConstructor.construct_yaml_binary>, 'tag:yaml.org,2002:timestamp': <function yaml_loader._construct_yaml_str>, 'tag:yaml.org,2002:omap': <function SafeConstructor.construct_yaml_omap>, 'tag:yaml.org,2002:pairs': <function SafeConstructor.construct_yaml_pairs>, 'tag:yaml.org,2002:set': <function SafeConstructor.construct_yaml_set>, 'tag:yaml.org,2002:str': <function yaml_loader._construct_yaml_str>, 'tag:yaml.org,2002:seq': <function SafeConstructor.construct_yaml_seq>, 'tag:yaml.org,2002:map': <function SafeConstructor.construct_yaml_map>, None: <function SafeConstructor.construct_undefined>}