k8s-deployer.py 文件源码

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

项目:k8s-deployer 作者: psyhomb 项目源码 文件源码
def load_config(config_file):
    """
    Load configuration from file (output: dict)
    """
    if os.path.isfile(config_file):
        try:
            with open(config_file, 'rU') as f:
                config = json.load(f)
        except ValueError:
            print('Wrong JSON format in {} file'.format(config_file))
            sys.exit(3)
        except IOError as e:
            print('Error while reading from file, {}'.format(e))
            sys.exit(2)
        else:
            return config
    else:
        print('Configuration file {} not found'.format(config_file))
        sys.exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号