template.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:clouds-aws 作者: elias5000 项目源码 文件源码
def save_parameters(stack, params):
    """saves parameters to disk"""
    # decode parameter dict
    params_dict = {}
    for param in params:
        params_dict[param['ParameterKey']] = param['ParameterValue']

    stack_dir = path.join('stacks', stack)
    param_path = path.join(stack_dir, 'parameters.yaml')

    # ensure paths are present
    if not path.exists('stacks'):
        mkdir('stacks')
    if not path.exists(stack_dir):
        mkdir(stack_dir)

    with open(param_path, mode='w', encoding='utf-8') as file:
        file.write(yaml.dump(params_dict, default_flow_style=False, explicit_start=True))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号