Exemple #1
0
 def execute(self, args):
     if not self.cfg.globals.enable_experimental:
         raise exception.ExperimentalFeature("The loadbalance command")
     if len(args) != 1:
         self.parser.error("please specify a <cluster_tag>")
     cluster_tag = args[0]
     cluster = self.cm.get_cluster(cluster_tag)
     lb = sge.SGELoadBalancer(**self.specified_options_dict)
     lb.run(cluster)
    def execute(self, args):
        if not self.cfg.globals.enable_experimental:
            raise exception.ExperimentalFeature("The 'loadbalance' command")
        if len(args) != 1:
            self.parser.error("please specify a <cluster_tag>")

        try:
            cluster_tag = args[0]
            cluster = self.cm.get_cluster(cluster_tag)
            cluster.recover(self.opts.reboot_interval,
                            self.opts.n_reboot_restart)
            lb = sge.SGELoadBalancer(**self.specified_options_dict)
            lb.run(cluster)
        except KeyboardInterrupt:
            import traceback
            # traceback.format_exc()
            self.log.info(traceback.format_exc())