def do_stop(self, arg):
        if not self.ctl.upcheck():
            return

        names = arg.strip().split()
        supervisor = self.ctl.get_supervisor()

        if not names:
            self.ctl.output('Error: stop requires a process name')
            self.help_stop()
            return

        if 'all' in names:
            results = supervisor.stopAllProcesses()
            for result in results:
                result = self._stopresult(result)
                self.ctl.output(result)

        else:
            for name in names:
                group_name, process_name = split_namespec(name)
                if process_name is None:
                    results = supervisor.stopProcessGroup(group_name)
                    for result in results:
                        result = self._stopresult(result)
                        self.ctl.output(result)
                else:
                    try:
                        result = supervisor.stopProcess(name)
                    except xmlrpclib.Fault, e:
                        error = self._stopresult({'status':e.faultCode,
                                                  'name':name,
                                                  'description':e.faultString})
                        self.ctl.output(error)
                    else:
                        self.ctl.output('%s: stopped' % name)
dataset/ETHPy150Open XiaoMi/minos/supervisor/supervisor/supervisorctl.py/DefaultControllerPlugin.do_stop/original