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)
评论列表
文章目录