Improved RpmPackage is_installed property logic.
This new logic verifies if there is a "not installed" string in the stdout when "rpm -q %s" command returns 1.
As seen in bug #758, if rpm command failed because of other reasons (such as database corruption), the old implementation was returning True, making the end-user think that the package was installed, however it was never queried.
@CarstenGrohmann , @philpep since you are the most active collaborators/maintainers, would you mind checking this quick PR? Thanks!
lgtm, I'd just use f-strings, as testinfra requires Python>=3.9.
I'm also interested in learning about review process here, looks like there is quite a number of PRs without a response.
LGTM, also. Please add a small test case.
@narmaku: I suggest to simplify the test as a corrupt database is not necessary:
$ rpm -q not_installed_pkg
package not_installed_pkg is not installed
$ echo $?
Merged, thanks!