Ejemplo n.º 1
0
    def _validate_pid(self, pid):
        """Validate the passed pid argument"""

        if not pid:
            pids = sconf.get_pids_for_process(self._run,
                                              self.execname)

            if len(pids) != 1:
                raise RuntimeError(
                    "There should be exactly one PID {0} for {1}".format(
                        pids,
                        self.execname))

            return pids[0]

        elif self.execname:

            pids = sconf.get_pids_for_process(self._run,
                                              self.execname)
            if pid not in pids:
                raise RuntimeError(
                    "PID {0} not mapped to {1}".format(
                        pid,
                        self.execname))
        else:
            self.execname = sconf.get_task_name(self._run, pid)

        return pid
Ejemplo n.º 2
0
    def _validate_pid(self, pid):
        """Validate the passed pid argument"""

        if not pid:
            pids = sconf.get_pids_for_process(self._run,
                                              self.execname)

            if len(pids) != 1:
                raise RuntimeError(
                    "There should be exactly one PID {0} for {1}".format(
                        pids,
                        self.execname))

            return pids[0]

        elif self.execname:

            pids = sconf.get_pids_for_process(self._run,
                                              self.execname)
            if pid not in pids:
                raise RuntimeError(
                    "PID {0} not mapped to {1}".format(
                        pid,
                        self.execname))
        else:
            self.execname = sconf.get_task_name(self._run, pid)

        return pid
Ejemplo n.º 3
0
    def _populate_pids(self, run):
        """Populate the qualifying PIDs from the run"""

        if len(self._execnames) == 1:
            return sconf.get_pids_for_process(run, self._execnames[0])

        pids = []

        for proc in self._execnames:
            pids += sconf.get_pids_for_process(run, proc)

        return list(set(pids))
Ejemplo n.º 4
0
    def _populate_pids(self):
        """Map the input execnames to PIDs"""

        if len(self._execnames) == 1:
            return sconf.get_pids_for_process(self._run, self._execnames[0])

        pids = []

        for proc in self._execnames:
            pids += sconf.get_pids_for_process(self._run, proc)

        return list(set(pids))
Ejemplo n.º 5
0
    def _populate_pids(self):
        """Map the input execnames to PIDs"""

        if len(self._execnames) == 1:
            return sconf.get_pids_for_process(self._run, self._execnames[0])

        pids = []

        for proc in self._execnames:
            pids += sconf.get_pids_for_process(self._run, proc)

        return list(set(pids))
Ejemplo n.º 6
0
    def _populate_pids(self, run):
        """Populate the qualifying PIDs from the run"""

        if len(self._execnames) == 1:
            return sconf.get_pids_for_process(run, self._execnames[0])

        pids = []

        for proc in self._execnames:
            pids += sconf.get_pids_for_process(run, proc)

        return list(set(pids))