tier.py 文件源码

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

项目:drift 作者: dgnorth 项目源码 文件源码
def init_command(args):
    # Fetch master config file from disk, url or s3 bucket.
    master_config = vars(args)["master-config"]
    json_text = fetch(master_config)
    if not json_text:
        return
    verify_master_config(json.loads(json_text))

    print "Initializing master config file {}".format(master_config)
    with open(get_config_path(TIERS_CONFIG_FILENAME), "w") as f:
        f.write(json_text)

    # Remove current tier selection
    tier_selection_file = get_config_path("TIER")
    if os.path.exists(tier_selection_file):
        os.remove(tier_selection_file)

    # Report currently selected config
    get_tiers_config()

    if args.activate:
        print "Activating tier '{}'...".format(args.activate)
        args.tier = args.activate
        args.vpn = False
        use_command(args)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号