Return restartcheck result and append errors (if any) to ``errors``
773764
def _get_restartcheck_result(errors):
    '''
    
    '''
    rs_result = __salt__['restartcheck.restartcheck'](verbose=False)
    if isinstance(rs_result, dict) and 'comment' in rs_result:
        errors.append(rs_result['comment'])
    return rs_result
323094
def _check_outcome(self, jobs):
        """"""
        if self.skip:
            return False

        if not jobs:
            logger.error("Import failed!")
            return False

        failed_jobs = []
        for job in jobs:
            status = job.get("status")
            if not status:
                failed_jobs.append(job)
                continue

            if status.lower() != "success":
                failed_jobs.append(job)

        for job in failed_jobs:
            logger.error("job: %s; status: %s", job.get("id"), job.get("status"))
        if len(failed_jobs) == len(jobs):
            logger.error("Import failed!")
        elif failed_jobs:
            logger.error("Some import jobs failed!")
        else:
            logger.info("Results successfully updated!")

        return not failed_jobs
733969
def content_check(self, result):
        '''
        
        '''
        if not isinstance(result, dict):
            err_msg = 'Malformed state return. Data must be a dictionary type.'
        elif not isinstance(result.get('changes'), dict):
            err_msg = "'Changes' should be a dictionary."
        else:
            missing = []
            for val in ['name', 'result', 'changes', 'comment']:
                if val not in result:
                    missing.append(val)
            if missing:
                err_msg = 'The following keys were not present in the state return: {0}.'.format(', '.join(missing))
            else:
                err_msg = None

        if err_msg:
            raise SaltException(err_msg)

        return result
239235
def clean_fails(self):
        
        for item in self.data:
            if item.failure and not item.retries_left > 0:
                return True
        return False
282952
def return_an_error(*args):
    '''
    '''
    list_errors = []
    list_errors.extend(list(args))

    errors = { 'errors': list_errors }
    return errors
964806
function (err, results) {
    err && console.error(err);

    results.forEach(function (result) {
        var failures = result.run.failures;

        console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
            `${result.collection.name} ran successfully.`);
    });
}
288416
def addError(self, test, err):
        
        super().addError(test, err)
        self.test_info(test)
        self._call_test_results('addError', test, err)
1320991
def addFailure(self, test: unittest.case.TestCase, exc_info: tuple) -> None:
        
        # noinspection PyTypeChecker
        self.add_result(TestState.failure, test, exc_info)
801500
def _process_async_error(self, resp_body, error_class):
        
        def _fmt_error(err):
            # Remove the cumbersome Java-esque message
            details = err.get("details", "").replace("\n", " ")
            if not details:
                details = err.get("message", "")
            return "%s (%s)" % (details, err.get("code", ""))

        error = resp_body.get("error", "")
        if "failedItems" in error:
            # Multi-error response
            faults = error.get("failedItems", {}).get("faults", [])
            msgs = [_fmt_error(fault) for fault in faults]
            msg = "\n".join(msgs)
        else:
            msg = _fmt_error(error)
        raise error_class(msg)
304195
def _repos_checked(self, worker, output, error):
        """"""
        if worker.repo in self._checking_repos:
            self._checking_repos.remove(worker.repo)

        if output:
            self._valid_repos.append(worker.repo)

        if len(self._checking_repos) == 0:
            self._download_repodata(self._valid_repos)
922405
def addError(self, test, err, capt=None):
        
        self.__insert_test_result(constants.State.ERROR, test, err)
254357
def add_error(self, error, critical=False):
    
    self.errors.append((error, critical))
440282
function(err, result) {
      if (err && !util.isError(err)) {
        err = new Error(err);
      }
      if (callback) callback(err, result);
    }
960263
def as_error(self) :
        ""
        result = dbus.Error.init()
        result.set(self.args[0], self.args[1])
        return \
            result
1188955
function (err, results) {

        if (!err) {

          self._startup(server);

          if (cb) cb();

        } else {

          for (var errNum in results) {
            if (results.hasOwnProperty(errNum)) {
              if (results[errNum]) {
                console.error('  - ' + results[errNum] + '\n');
              }
            }
          }

          process.exit(1);
        }
      }
870441
def check_error(result, func, cargs):
    ""
    if result != 0:
        msg = 'Error in "%s": %s' % (func.__name__, get_errors(result) )
        raise RTreeError(msg)
    return
407752
def restart():
    
    python = sys.executable
    os.execl(python, python, * sys.argv)