stacker/config/__init__.py
def parse(raw_config):
    """Parse a raw yaml formatted stacker config.

    Args:
        raw_config (str): the raw stacker configuration string in yaml format.

    Returns:
        :class:`Config`: the parsed stacker config.

    """

    # Convert any applicable dictionaries back into lists
    # This is necessary due to the move from lists for these top level config
    # values to either lists or OrderedDicts.
    # Eventually we should probably just make them OrderedDicts only.
    config_dict = yaml_to_ordered_dict(raw_config)
    if config_dict:
        for top_level_key in ['stacks', 'pre_build', 'post_build',
                              'pre_destroy', 'post_destroy']:
            top_level_value = config_dict.get(top_level_key)
            if isinstance(top_level_value, dict):
                tmp_list = []
                for key, value in top_level_value.iteritems():
                    tmp_dict = copy.deepcopy(value)
                    if top_level_key == 'stacks':
                        tmp_dict['name'] = key
                    tmp_list.append(tmp_dict)
                config_dict[top_level_key] = tmp_list

    # We have to enable non-strict mode, because people may be including top
    # level keys for re-use with stacks (e.g. including something like
    # `common_variables: &common_variables`).
    #
    # The unfortunate side effect of this is that it propagates down to every
    # schematics model, and there doesn't seem to be a good way to only disable
    # strict mode on a single model.
    #
    # If we enabled strict mode, it would break backwards compatibility, so we
    # should consider enabling this in the future.
    strict = False

    return Config(config_dict, strict=strict)
Parse a raw yaml formatted stacker config.

    Args:
        raw_config (str): the raw stacker configuration string in yaml format.

    Returns:
        :class:`Config`: the parsed stacker config.

    
Parse a raw yaml formatted stacker config.
Parse a raw yaml formatted stacker config .
def parse(raw_config):
    config_dict = yaml_to_ordered_dict(raw_config)
    if config_dict:
        for top_level_key in ['stacks', 'pre_build', 'post_build',
                              'pre_destroy', 'post_destroy']:
            top_level_value = config_dict.get(top_level_key)
            if isinstance(top_level_value, dict):
                tmp_list = []
                for key, value in top_level_value.iteritems():
                    tmp_dict = copy.deepcopy(value)
                    if top_level_key == 'stacks':
                        tmp_dict['name'] = key
                    tmp_list.append(tmp_dict)
                config_dict[top_level_key] = tmp_list
     The unfortunate side effect of this is that it propagates down to every
     schematics model, and there doesn't seem to be a good way to only disable
     strict mode on a single model.
     If we enabled strict mode, it would break backwards compatibility, so we
     should consider enabling this in the future.
    strict = False
    return Config(config_dict, strict=strict)
def parse ( raw_config ) : config_dict = yaml_to_ordered_dict ( raw_config ) if config_dict : for top_level_key in [ 'stacks' , 'pre_build' , 'post_build' , 'pre_destroy' , 'post_destroy' ] : top_level_value = config_dict . get ( top_level_key ) if isinstance ( top_level_value , dict ) : tmp_list = [ ] for key , value in top_level_value . iteritems ( ) : tmp_dict = copy . deepcopy ( value ) if top_level_key == 'stacks' : tmp_dict [ 'name' ] = key tmp_list . append ( tmp_dict ) config_dict [ top_level_key ] = tmp_list strict = False return Config ( config_dict , strict = strict )
Parse a raw yaml formatted stacker config.
Parse a raw yaml formatted stacker config .
"""Parse a raw yaml formatted stacker config.

    Args:
        raw_config (str): the raw stacker configuration string in yaml format.

    Returns:
        :class:`Config`: the parsed stacker config.

    """ # Convert any applicable dictionaries back into lists # This is necessary due to the move from lists for these top level config # values to either lists or OrderedDicts. # Eventually we should probably just make them OrderedDicts only. # We have to enable non-strict mode, because people may be including top # level keys for re-use with stacks (e.g. including something like # `common_variables: &common_variables`). # # The unfortunate side effect of this is that it propagates down to every # schematics model, and there doesn't seem to be a good way to only disable # strict mode on a single model. # # If we enabled strict mode, it would break backwards compatibility, so we # should consider enabling this in the future.
:class:`Config`: the parsed stacker config.
: class : ` Config ` : the parsed stacker config .
raw_config
the raw stacker configuration string in yaml format.
the raw stacker configuration string in yaml format .