correctly detect pkg_mgr on fedora/rhel/centos rpm-ostree installed (#49256)

Check the path /run/ostree-booted which I'm told by upstream that it
will always be present when a host system is Fedora/RHEL/CentOS
Atomic/CoreOS vs "traditional" distro instance to detect the
non-traditional instance and ensure pkg_mgr selection is correct

Signed-off-by: Adam Miller <admiller@redhat.com>
pull/51851/head
Adam Miller 6 years ago committed by Sam Doran
parent 959939b866
commit 9bb05b72b2

@ -0,0 +1,2 @@
bugfixes:
- "facts - properly detect package manager for a Fedora/RHEL/CentOS system that has rpm-ostree installed"

@ -61,6 +61,8 @@ class PkgMgrFactCollector(BaseFactCollector):
def _check_rh_versions(self, pkg_mgr_name, collected_facts):
if collected_facts['ansible_distribution'] == 'Fedora':
if os.path.exists('/run/ostree-booted'):
return "atomic_container"
try:
if int(collected_facts['ansible_distribution_major_version']) < 23:
for yum in [pkg_mgr for pkg_mgr in PKG_MGRS if pkg_mgr['name'] == 'yum']:

Loading…
Cancel
Save