def list_command(args):
tiers_config = get_tiers_config()
conn = connect_to_region(tiers_config["region"], calling_format=OrdinaryCallingFormat())
bucket_name = "{}.{}".format(tiers_config["bucket"], tiers_config["domain"])
print "List of all tiers registered at http://{}/{}".format(bucket_name, "tiers")
bucket = conn.get_bucket(bucket_name)
for file_key in bucket.list("tiers/", "/"):
head, tail = os.path.split(file_key.name)
root, ext = os.path.splitext(tail)
if ext == ".json":
if args.verbose:
print bcolors.BOLD + "Tier: " + root + bcolors.ENDC
json_text = file_key.get_contents_as_string()
print json_text
else:
print " ", root
评论列表
文章目录