def machines_describe(arg_vars, project_root):
cluster_id = arg_vars['cluster_id']
path = util.machine_profiles_path(project_root, cluster_id)
if exists(path):
files = [f for f in listdir(path) if isfile(join(path, f))]
t = PrettyTable(['Profile ID', 'Size', 'Services', 'Desired Count'])
t.align = "l"
t.align["Desired Count"] = "c"
for f in files:
with open(path + "/" + f, 'r') as stream:
content = yaml.load(stream)
t.add_row([content['profile_id'],
content['ec2_instance_type'],
", ".join(content.get('machine_services', [])),
content['n_machine_instances']])
print t
else:
print_fail("No machine profiles were found for this cluster.")
评论列表
文章目录