Exemple #1
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False 

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        spawn = spawn_cmd(logPrefix, cmd=self.get_args(), capture_output=self.capture_output)
        self.ps = spawn[0]
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        # see https://docs.python.org/2/library/subprocess.html#subprocess.Popen
        # for why I'm using shlex to split the cmd string into a sequence
        # confusing issues, especially when thinking about windows too
        # OS/build     | os.name | platform.system()
        # -------------+---------+-----------------------
        # Win32 native | nt      | Windows
        # Win32 cygwin | posix   | CYGWIN_NT-5.1*
        # Win64 native | nt      | Windows
        # Win64 cygwin | posix   | CYGWIN_NT-6.1-WOW64*
        # Linux        | posix   | Linux

        # make it a string if cygwin or windows
        # in unix, the args was created with split by space. (assumption is no pathname has space)
        # need to pass string in windows..doesn't seem to assemble string from args list correctly
        # could make unix use shell and pass string?
        pf = platform.system()
        print "System is %s" % pf
        cmd = self.get_args()
        if re.match('win', pf, re.IGNORECASE):  # covers cygwin and windows
            cmd = " ".join(cmd)
        spawn = spawn_cmd(logPrefix,
                          cmd=cmd,
                          capture_output=self.capture_output)
        self.ps = spawn[0]
Exemple #3
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        spawn = spawn_cmd(logPrefix,
                          cmd=self.get_args(),
                          capture_output=self.capture_output)
        self.ps = spawn[0]
Exemple #4
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False 

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        # see https://docs.python.org/2/library/subprocess.html#subprocess.Popen
        # for why I'm using shlex to split the cmd string into a sequence
        # confusing issues, especially when thinking about windows too
        # OS/build     | os.name | platform.system() 
        # -------------+---------+-----------------------
        # Win32 native | nt      | Windows
        # Win32 cygwin | posix   | CYGWIN_NT-5.1*
        # Win64 native | nt      | Windows
        # Win64 cygwin | posix   | CYGWIN_NT-6.1-WOW64*
        # Linux        | posix   | Linux

        # make it a string if cygwin or windows
        # in unix, the args was created with split by space. (assumption is no pathname has space)
        # need to pass string in windows..doesn't seem to assemble string from args list correctly
        # could make unix use shell and pass string?
        pf = platform.system()
        print "System is %s" % pf
        cmd = self.get_args()
        if re.match('win', pf, re.IGNORECASE): # covers cygwin and windows
            cmd = " ".join(cmd)
        spawn = spawn_cmd(logPrefix, cmd=cmd, capture_output=self.capture_output)
        self.ps = spawn[0]
Exemple #5
0
    def __init__(self, *args, **kwargs):
        super(LocalH2O, self).__init__(*args, **kwargs)
        self.rc = None
        # FIX! no option for local /home/username ..always the sandbox (LOG_DIR)
        self.ice = tmp_dir('ice.')
        self.flatfile = flatfile_pathname()
        # so we can tell if we're remote or local. Apparently used in h2o_import.py
        self.remoteH2O = False 

        h2o_os_util.check_port_group(self.port)
        h2o_os_util.show_h2o_processes()

        if self.node_id is not None:
            logPrefix = 'local-h2o-' + str(self.node_id)
        else:
            logPrefix = 'local-h2o'

        # see https://docs.python.org/2/library/subprocess.html#subprocess.Popen
        # for why I'm using shlex to split the cmd string into a sequence
        # confusing issues, especially when thinking about windows too
        cmd = " ".join(self.get_args())
        cmdSplit = shlex.split(cmd)
        spawn = spawn_cmd(logPrefix, cmd=cmdSplit, capture_output=self.capture_output)
        self.ps = spawn[0]