def set_process_ionice(self, ioclass, value): if ioclass in (IOPRIO_CLASS_NONE, None): if value: raise ValueError("can't specify value with IOPRIO_CLASS_NONE") ioclass = IOPRIO_CLASS_NONE value = 0 if ioclass in (IOPRIO_CLASS_RT, IOPRIO_CLASS_BE): if value is None: value = 4 elif ioclass == IOPRIO_CLASS_IDLE: if value: raise ValueError("can't specify value with IOPRIO_CLASS_IDLE") value = 0 else: value = 0 if not 0 <= value <= 8: raise ValueError("value argument range expected is between 0 and 8") return _psutil_linux.ioprio_set(self.pid, ioclass, value)
def set_process_ionice(self, ioclass, iodata): if ioclass in (IOPRIO_CLASS_NONE, None): if iodata: raise ValueError("can't specify iodata with IOPRIO_CLASS_NONE") ioclass = IOPRIO_CLASS_NONE iodata = 0 if ioclass in (IOPRIO_CLASS_RT, IOPRIO_CLASS_BE): if iodata is None: iodata = 4 elif ioclass == IOPRIO_CLASS_IDLE: if iodata: raise ValueError("can't specify iodata with IOPRIO_CLASS_IDLE") iodata = 0 else: iodata = 0 if not 0 <= iodata <= 8: raise ValueError("iodata argument range expected is between 0 and 8") return _psutil_linux.ioprio_set(self.pid, ioclass, iodata)
def set_process_ionice(self, ioclass, iodata): if ioclass in (IOPRIO_CLASS_NONE, None): if iodata: raise ValueError( "can't specify iodata with IOPRIO_CLASS_NONE") ioclass = IOPRIO_CLASS_NONE iodata = 0 if ioclass in (IOPRIO_CLASS_RT, IOPRIO_CLASS_BE): if iodata is None: iodata = 4 elif ioclass == IOPRIO_CLASS_IDLE: if iodata: raise ValueError( "can't specify iodata with IOPRIO_CLASS_IDLE") iodata = 0 else: iodata = 0 if not 0 <= iodata <= 8: raise ValueError( "iodata argument range expected is between 0 and 8") return _psutil_linux.ioprio_set(self.pid, ioclass, iodata)