Ejemplo n.º 1
0
    def execute(self):
        storage = Configurator().create_cluster_storage()
        cluster_names = storage.get_stored_clusters()

        if not cluster_names:
            print("No clusters found.")
        else:
            print("""
The following clusters have been started.
Please note that there's no guarantee that they are fully configured:
""")
            for name in sorted(cluster_names):
                try:
                    cluster = Configurator().load_cluster(name)
                except ConfigurationError, ex:
                    log.error("gettin information from cluster `%s`: %s",
                              name, ex)
                    continue
                print("%s " % name)
                print("-"*len(name))
                print("  name:           %s" % cluster.name)
                print("  template:       %s" % cluster.template)
                print("  cloud:          %s " % cluster._cloud)
                for cls in cluster.nodes:
                    print("  - %s nodes: %d" % (cls, len(cluster.nodes[cls])))
                print("")