~apport-hackers/apport/main

Viewing all changes in revision 3913.

  • Committer: Simon Chopin
  • Author(s): Benjamin Drung
  • Date: 2023-04-28 08:41:38 UTC
  • Revision ID: git-v1:289994d7b25f33d07d8cb5786560216c3c89c78a
fix: Use ProblemReport for running generic hook manually

Running the generic general hook manually fails:

```
$ python3 data/general-hooks/generic.py
Traceback (most recent call last):
  File "/home/bdrung/projects/apport/apport/data/general-hooks/generic.py", line 129, in <module>
    add_info(r, None)
  File "/home/bdrung/projects/apport/apport/data/general-hooks/generic.py", line 123, in add_info
    if report["ProblemType"] == "Crash":
       ~~~~~~^^^^^^^^^^^^^^^
KeyError: 'ProblemType'
```

Use an instance of `ProblemReport` like Apport would use.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: