Created
January 15, 2010 21:32
-
-
Save oldpatricka/278434 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if cli_options.all_cluster: | |
print s.get_cluster_resources() | |
elif cli_options.vms: | |
print s.get_cluster_vm_resources() | |
elif cli_options.vm_id and cli_options.cluster_name: | |
print s.get_vm_info(cli_options.cluster_name, cli_options.vm_id) | |
elif cli_options.vm_id and not cli_options.cluster_name: | |
print "Please provide -c cluster_name with vm ID" | |
elif cli_options.cluster_name and not cli_options.vm_id: | |
print s.get_cluster_info(cli_options.cluster_name) | |
elif cli_options.json and cli_options.all_cluster: | |
print s.get_json_resource() | |
elif cli_options.json and cli_options.vm_id and cli_options.cluster_name: | |
print s.get_json_vm(cli_options.cluster_name, cli_options.vm_id) | |
elif cli_options.json and cli_options.cluster_name and not cli_options.vm_id: | |
print s.get_json_cluster(cli_options.cluster_name) | |
elif (cli_options.dev_info): | |
print s.get_developer_information() | |
else: | |
print s.get_cloud_resources() | |
# Should probably be | |
# JSON stuff first | |
if cli_options.json and cli_options.all_cluster: | |
print s.get_json_resource() | |
elif cli_options.json and cli_options.vm_id and cli_options.cluster_name: | |
print s.get_json_vm(cli_options.cluster_name, cli_options.vm_id) | |
elif cli_options.json and cli_options.cluster_name and not cli_options.vm_id: | |
print s.get_json_cluster(cli_options.cluster_name) | |
elif cli_options.all_cluster: | |
print s.get_cluster_resources() | |
# then other stuff | |
elif cli_options.vms: | |
print s.get_cluster_vm_resources() | |
elif cli_options.vm_id and cli_options.cluster_name: | |
print s.get_vm_info(cli_options.cluster_name, cli_options.vm_id) | |
elif cli_options.vm_id and not cli_options.cluster_name: | |
print "Please provide -c cluster_name with vm ID" | |
elif cli_options.cluster_name and not cli_options.vm_id: | |
print s.get_cluster_info(cli_options.cluster_name) | |
elif (cli_options.dev_info): | |
print s.get_developer_information() | |
else: | |
print s.get_cloud_resources() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment