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
pull/40739/head
Konstantin Gribov 7 years ago committed by Adam Miller
parent 04e3c964fb
commit f2d4912f29

@ -78,5 +78,10 @@ class PkgMgrFactCollector(BaseFactCollector):
if os.path.exists(pkg['path']): if os.path.exists(pkg['path']):
pkg_mgr_name = pkg['name'] 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 facts_dict['pkg_mgr'] = pkg_mgr_name
return facts_dict return facts_dict

Loading…
Cancel
Save