Esempio n. 1
0
    def __init__(self, host, cmdModifier=None):
        """Create a Host task that will connect to the given host name
        via ssh.  host must be a routable host name for any of the
        hosts used in the experiment.  DO NOT use 'localhost'.  This
        will automatically detect if host is the local host and forgo
        ssh.

        cmdModifier, if given, is a function that can modify
        the ssh command; it will be passed the ssh part of the
        command, the sudo part of the command, and the remote server
        execution part of the command and should return the actual
        command to execute."""

        # Just a sanity check
        if host == "localhost" or host == "127.0.0.1":
            raise ValueError("Host name must be routable from all of the "
                             "hosts in the experiment.")

        Task.__init__(self, host=host)
        self.host = host
        self.__cmdModifier = cmdModifier
        self.__routes = {}
        self.__rConn = None
        self.__sudoConn = None
        self.__rootDir = "/tmp/mparts-%x" % abs(hash(SCRIPT_PATH))
        self.__isLocalhost = isLocalhost(host)

        for p in ["__init__.py", "server.py", "rpc.py"]:
            self.queueSrcFile(self, p)
Esempio n. 2
0
    def __init__(self, host, cmdModifier = None):
        """Create a Host task that will connect to the given host name
        via ssh.  host must be a routable host name for any of the
        hosts used in the experiment.  DO NOT use 'localhost'.  This
        will automatically detect if host is the local host and forgo
        ssh.

        cmdModifier, if given, is a function that can modify
        the ssh command; it will be passed the ssh part of the
        command, the sudo part of the command, and the remote server
        execution part of the command and should return the actual
        command to execute."""

        # Just a sanity check
        if host == "localhost" or host == "127.0.0.1":
            raise ValueError("Host name must be routable from all of the "
                             "hosts in the experiment.")

        Task.__init__(self, host = host)
        self.host = host
        self.__cmdModifier = cmdModifier
        self.__routes = {}
        self.__rConn = None
        self.__sudoConn = None
        self.__rootDir = "/tmp/mparts-%x" % abs(hash(SCRIPT_PATH))
        self.__isLocalhost = isLocalhost(host)

        for p in ["__init__.py", "server.py", "rpc.py"]:
            self.queueSrcFile(self, p)
Esempio n. 3
0
 def __init__(self, host):
     Task.__init__(self, host=host)
     self.host = host
     self.uname = self.kernel = None
     self.sysctla = None
Esempio n. 4
0
 def __init__(self, host):
     Task.__init__(self, host = host)
     self.host = host
     self.uname = self.kernel = None
     self.sysctla = None
Esempio n. 5
0
 def run(self):
     return Task(self.codedic, self.iolist, 1)