def run(self, arguments): problems = match_get_problems(arguments.patterns, authenticate=arguments.authenticate, executables=arguments.executables, components=arguments.components, since=arguments.since, until=arguments.until, n_latest=arguments.n_latest, not_reported=arguments.not_reported) for problem in problems: if not isinstance(problem, Ccpp): print( _('The problem is not of a C/C++ type. Can\'t install debuginfo' )) sys.exit(1) problem.chown() with remember_cwd(): try: os.chdir(problem.path) except OSError: print( _('Permission denied: \'{}\'\n' 'If this is a system problem' ' try running this command as root').format( problem.path)) sys.exit(1) subprocess.call(config.DEBUGINFO_INSTALL_CMD, shell=True)
def run(self, arguments): problems = match_get_problems(arguments.patterns, authenticate=arguments.authenticate, executables=arguments.executables, components=arguments.components, since=arguments.since, until=arguments.until, n_latest=arguments.n_latest, not_reported=arguments.not_reported) for problem in problems: if problem.not_reportable and not arguments.unsafe: if reportclient.verbose > 0: print(problem.not_reportable_reason) print(_('Problem \'{0}\' cannot be reported').format(problem.short_id)) sys.exit(1) flags = report.LIBREPORT_WAIT | report.LIBREPORT_RUN_CLI if arguments.unsafe: flags |= report.LIBREPORT_IGNORE_NOT_REPORTABLE problem.chown() print(_("Reporting problem %s\n" % (problem.short_id))) report.report_problem_in_dir(problem.path, flags) if arguments.delete: problem.delete(problem.path)
def run(self, arguments): problems = match_get_problems(arguments.patterns, authenticate=arguments.authenticate, executables=arguments.executables, components=arguments.components, since=arguments.since, until=arguments.until, n_latest=arguments.n_latest, not_reported=arguments.not_reported) fmt = arguments.format if not fmt: fmt = getattr(config, '{}_FMT'.format(arguments.pretty.upper())) print(format_problems(problems, fmt=fmt))
def run(self, arguments): # We don’t get these bad boys when invoked by the “backtrace” command. local = getattr(arguments, 'local', False) remote = getattr(arguments, 'remote', False) force = getattr(arguments, 'force', False) problems = match_get_problems(arguments.patterns, authenticate=arguments.authenticate, executables=arguments.executables, components=arguments.components, since=arguments.since, until=arguments.until, n_latest=arguments.n_latest, not_reported=arguments.not_reported) for problem in problems: if hasattr(problem, 'backtrace') and not force: print(_('Problem already has a backtrace')) print(_('Run abrt retrace with -f/--force to retrace again')) if ask_yes_no(_('Show backtrace?')): print(format_problems(problem, fmt=config.BACKTRACE_FMT)) elif not isinstance(problem, Ccpp): print(_('No retracing possible for this problem type')) else: if not (local or remote): ret = ask_yes_no( _('Upload core dump and perform remote' ' retracing? (It may contain sensitive data).' ' If your answer is \'No\', a stack trace will' ' be generated locally. Local retracing' ' requires downloading potentially large amount' ' of debuginfo data')) if ret: remote = True else: local = True problem.chown() if remote: print(_('Remote retracing')) run_event('analyze_RetraceServer', problem) else: print(_('Local retracing')) run_event('analyze_LocalGDB', problem)
def run(self, arguments): problems = match_get_problems(arguments.patterns, authenticate=arguments.authenticate, executables=arguments.executables, components=arguments.components, since=arguments.since, until=arguments.until, n_latest=arguments.n_latest, not_reported=arguments.not_reported) for problem in problems: print(format_problems(problem, fmt=config.FULL_FMT), '\n') if not arguments.force: if not ask_yes_no( _('Are you sure you want to delete this problem?')): continue problem.delete() print(_('Removed'), '\n')
def run(self, arguments): problems = match_get_problems(arguments.patterns, authenticate=arguments.authenticate, executables=arguments.executables, components=arguments.components, since=arguments.since, until=arguments.until, n_latest=arguments.n_latest, not_reported=arguments.not_reported) for problem in problems: if hasattr(problem, 'backtrace'): print(format_problems(problem, fmt=config.BACKTRACE_FMT)) else: print(_('Problem has no backtrace')) if isinstance(problem, Ccpp): if ask_yes_no(_('Start retracing process?')): run_command('retrace', arguments) print( format_problems(problem, fmt=config.BACKTRACE_FMT))
def test_match_get_problems(self): with self.assertRaises(SystemExit): match_get_problems(['adun toridas'])