def status(self):
        st = "unk  "
        if self.handle:
            rc = self.handle.returncode
            if rc:
                st = " rc:{}".format(rc)
            else:
                st = " pid:{}".format(self.handle.pid)

        log = ""
        if os.path.exists(self.logFile):
            s = os.stat(self.logFile)
            if s.st_size > 0:
                log = "log: {}".format(human_size(s.st_size))
        out = ""
        if os.path.exists(self.stdoutFile):
            s = os.stat(self.stdoutFile)
            if s.st_size > 0:
                out = "out: {}".format(human_size(s.st_size))
        err = ""
        if os.path.exists(self.stderrFile):
            s = os.stat(self.stderrFile)
            if s.st_size > 0:
                err = "err: {}".format(human_size(s.st_size))
        errors = ""
        try:
            self.check_error()
        except ValidatorManagerException:
            errors = "errs!"

        return "{}: {} {} {} {} {}".format(self.Id, st, out, err, log, errors)
예제 #2
0
    def status(self):
        st = "unk  "
        if self._handle:
            rc = self._handle.returncode
            if rc:
                st = " rc:{}".format(rc)
            else:
                st = " pid:{}".format(self._handle.pid)

        log = ""
        if os.path.exists(self._log_file):
            s = os.stat(self._log_file)
            if s.st_size > 0:
                log = "log: {}".format(human_size(s.st_size))
        out = ""
        if os.path.exists(self._stdout_file):
            s = os.stat(self._stdout_file)
            if s.st_size > 0:
                out = "out: {}".format(human_size(s.st_size))
        err = ""
        if os.path.exists(self._stderr_file):
            s = os.stat(self._stderr_file)
            if s.st_size > 0:
                err = "err: {}".format(human_size(s.st_size))
        errors = ""
        try:
            self.check_error()
        except ValidatorManagerException:
            errors = "errs!"

        return "{} {}: {} {} {} {} {}".format(self._address, self.name, st,
                                              out, err, log, errors)
    def status(self):
        st = "UNK  "
        if self.handle:
            rc = self.handle.returncode
            if rc:
                st = " rc:{}".format(rc)
            else:
                st = " pid:{}".format(self.handle.pid)

        log = ""
        if os.path.exists(self.logFile):
            s = os.stat(self.logFile)
            if s.st_size > 0:
                log = "LOG: {}".format(human_size(s.st_size))
        out = ""
        if os.path.exists(self.stdoutFile):
            s = os.stat(self.stdoutFile)
            if s.st_size > 0:
                out = "LOG: {}".format(human_size(s.st_size))
        err = ""
        if os.path.exists(self.stderrFile):
            s = os.stat(self.stderrFile)
            if s.st_size > 0:
                err = "LOG: {}".format(human_size(s.st_size))
        errors = "ERROR" if self.has_error() else ""

        print("{}: {} {} {} {} {}".format(self.Id, st, out, err, log, errors))
예제 #4
0
    def status(self):
        st = "unk  "
        if self.handle:
            rc = self.handle.returncode
            if rc:
                st = " rc:{}".format(rc)
            else:
                st = " pid:{}".format(self.handle.pid)

        log = ""
        if os.path.exists(self.logFile):
            s = os.stat(self.logFile)
            if s.st_size > 0:
                log = "log: {}".format(human_size(s.st_size))
        out = ""
        if os.path.exists(self.stdoutFile):
            s = os.stat(self.stdoutFile)
            if s.st_size > 0:
                out = "out: {}".format(human_size(s.st_size))
        err = ""
        if os.path.exists(self.stderrFile):
            s = os.stat(self.stderrFile)
            if s.st_size > 0:
                err = "err: {}".format(human_size(s.st_size))
        errors = "errs!" if self.has_error() else ""

        return "{}: {} {} {} {} {}".format(self.Id, st, out, err, log, errors)
    def status(self):
        st = "UNK  "
        if self.handle:
            rc = self.handle.returncode
            if rc:
                st = " rc:{}".format(rc)
            else:
                st = " pid:{}".format(self.handle.pid)

        log = ""
        if os.path.exists(self.logFile):
            s = os.stat(self.logFile)
            if s.st_size > 0:
                log = "LOG: {}".format(human_size(s.st_size))
        out = ""
        if os.path.exists(self.stdoutFile):
            s = os.stat(self.stdoutFile)
            if s.st_size > 0:
                out = "LOG: {}".format(human_size(s.st_size))
        err = ""
        if os.path.exists(self.stderrFile):
            s = os.stat(self.stderrFile)
            if s.st_size > 0:
                err = "LOG: {}".format(human_size(s.st_size))
        errors = "ERROR" if self.has_error() else ""

        print("{}: {} {} {} {} {}".format(self.Id, st, out, err, log, errors))