# Path: heatclient/_i18n.py
# def get_available_languages():
# def enable_lazy():
# 
# Path: heatclient/common/template_format.py
# class yaml_loader(yaml_loader_base):
# class yaml_dumper(yaml_dumper_base):
# def _construct_yaml_str(self, node):
# def parse(tmpl_str):


import yaml
from heatclient._i18n import _
from heatclient.common import template_format
    'encrypted_param_names', 'event_sinks',
    'parameter_merge_strategies'
)


def parse(env_str):
    """Takes a string and returns a dict containing the parsed structure.

    This includes determination of whether the string is using the
    YAML format.
    """
    try:
        env = yaml.load(env_str, Loader=template_format.yaml_loader)
    except yaml.YAMLError:
        # NOTE(prazumovsky): we need to return more informative error for
        # user, so use SafeLoader, which return error message with template
        # snippet where error has been occurred.
        try:
            env = yaml.load(env_str, Loader=yaml.SafeLoader)
        except yaml.YAMLError as yea:
            raise ValueError(yea)
    else:
        if env is None:
            env = {}
        elif not isinstance(env, dict):
            raise ValueError(_('The environment is not a valid '
                             'YAML mapping data type.'))

    for param in env:
        if param not in SECTIONS:

# Path: heatclient/_i18n.py
# def get_available_languages():
# def enable_lazy():
# 
# Path: heatclient/common/template_format.py
# class yaml_loader(yaml_loader_base):
# class yaml_dumper(yaml_dumper_base):
# def _construct_yaml_str(self, node):
# def parse(tmpl_str):


# Path: heatclient/common/environment_format.py
import yaml
from heatclient._i18n import _
from heatclient.common import template_format

    'encrypted_param_names', 'event_sinks',
    'parameter_merge_strategies'
)


def parse(env_str):
    """Takes a string and returns a dict containing the parsed structure.

    This includes determination of whether the string is using the
    YAML format.
    """
    try:
        env = yaml.load(env_str, Loader=template_format.yaml_loader)
    except yaml.YAMLError:
        # NOTE(prazumovsky): we need to return more informative error for
        # user, so use SafeLoader, which return error message with template
        # snippet where error has been occurred.
        try:
            env = yaml.load(env_str, Loader=yaml.SafeLoader)
        except yaml.YAMLError as yea:
            raise ValueError(yea)
    else:
        if env is None:
            env = {}
        elif not isinstance(env, dict):
            raise ValueError(_('The environment is not a valid '
                             'YAML mapping data type.'))

    for param in env:
        if param not in SECTIONS:

            raise ValueError(_('environment has wrong section "%s"') % param)