Skip to content

Commit 1133428

Browse files
dcermakphilpep
authored andcommitted
Use RpmPackage on CentOS and Fedora and not only on CentOS
On Fedora you can also install dpkg, which will cause testinfra to think that the package manager is actually DPKG and not RPM. Thus we instead use the system_info.distribution value to prefer rpm on Fedora
1 parent a276c11 commit 1133428

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

testinfra/modules/package.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ def get_module_class(cls, host):
7070
return OpenBSDPackage
7171
if host.system_info.distribution in ("debian", "ubuntu"):
7272
return DebianPackage
73-
if (
74-
host.system_info.distribution
75-
and host.system_info.distribution.lower() == "centos"
73+
if host.system_info.distribution and (
74+
host.system_info.distribution.lower()
75+
in (
76+
"centos",
77+
"fedora",
78+
)
7679
):
7780
return RpmPackage
7881
if host.system_info.distribution == "arch":

0 commit comments

Comments
 (0)