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())
Exemple #3
0
 def execute(self, args):
     if not self.cfg.globals.enable_experimental:
         raise exception.ExperimentalFeature("The 'get' command")
     if len(args) < 3:
         self.parser.error("please specify a cluster, remote file or " +
                           "directory, and a local destination path")
     ctag = args[0]
     lpath = args[-1]
     rpaths = args[1:-1]
     cl = self.cm.get_cluster(ctag)
     node = cl.get_node_by_alias(self.opts.node)
     if self.opts.user:
         node.ssh.switch_user(self.opts.user)
     for rpath in rpaths:
         if not glob.has_magic(rpath) and not node.ssh.path_exists(rpath):
             raise exception.BaseException(
                 "Remote file or directory does not exist: %s" % rpath)
     node.ssh.get(rpaths, lpath)
Exemple #4
0
 def execute(self, args):
     if not self.cfg.globals.enable_experimental:
         raise exception.ExperimentalFeature("The 'put' command")
     if len(args) < 3:
         self.parser.error("please specify a cluster, local files or " +
                           "directories, and a remote destination path")
     ctag = args[0]
     rpath = args[-1]
     lpaths = args[1:-1]
     for lpath in lpaths:
         if not os.path.exists(lpath):
             raise exception.BaseException(
                 "Local file or directory does not exist: %s" % lpath)
     cl = self.cm.get_cluster(ctag)
     node = cl.get_node_by_alias(self.opts.node)
     if self.opts.user:
         node.ssh.switch_user(self.opts.user)
     if len(lpaths) > 1 and not node.ssh.isdir(rpath):
         raise exception.BaseException("Remote path does not exist: %s" %
                                       rpath)
     node.ssh.put(lpaths, rpath)