Skip to content

Commit fd37cfd

Browse files
committed
Fix: DNF have less parameters than yum
1 parent 3ef3560 commit fd37cfd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

opsbro/system_backends/system_backend_yum.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ def _try_to_import_lib(self, allow_logs=True):
4949
def _try_detect_dnf(self):
5050
if self._is_dnf_detected:
5151
return
52-
p = subprocess.Popen(['dnf5', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
52+
try:
53+
p = subprocess.Popen(['dnf5', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
54+
except subprocess.SubprocessError:
55+
self._is_dnf = False
56+
self._is_dnf_detected = True
57+
return
5358
_, _ = p.communicate()
5459
if p.returncode == 0:
5560
self._is_dnf = True

0 commit comments

Comments
 (0)