module_utils/facts: override pkg_mgr for ALT Linux (#38004)
Overrides `pkg_mgr` fact to `apt_rpm` if: - found package manager is `apt`; - `/usr/bin/rpm` is present; - `/usr/bin/dpkg` is absent. Fixes #37997
This commit is contained in:
parent
04e3c964fb
commit
f2d4912f29
1 changed files with 5 additions and 0 deletions
|
@ -78,5 +78,10 @@ class PkgMgrFactCollector(BaseFactCollector):
|
|||
if os.path.exists(pkg['path']):
|
||||
pkg_mgr_name = pkg['name']
|
||||
|
||||
if pkg_mgr_name == 'apt' and \
|
||||
os.path.exists('/usr/bin/rpm') and \
|
||||
not os.path.exists('/usr/bin/dpkg'):
|
||||
pkg_mgr_name = 'apt_rpm'
|
||||
|
||||
facts_dict['pkg_mgr'] = pkg_mgr_name
|
||||
return facts_dict
|
||||
|
|
Loading…
Reference in a new issue