Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1741183: Yum loaded subscription-manager plugin multiple times #2204

Merged
merged 1 commit into from Jan 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/rhsm/profile.py
Expand Up @@ -144,6 +144,11 @@ def __init__(self, repo_file):
:param path: A .repo file path used to filter the report.
:type path: str
"""
if dnf is not None:
self.db = dnf.dnf.Base()
elif yum is not None:
self.yb = yum.YumBase()

self.repofile = repo_file
self.content = self.__generate()

Expand Down Expand Up @@ -175,12 +180,10 @@ def _obtain_mappings(self):
raise ImportError

def _obtain_mappings_dnf(self):
db = dnf.dnf.Base()
return {'releasever': db.conf.substitutions['releasever'], 'basearch': db.conf.substitutions['basearch']}
return {'releasever': self.db.conf.substitutions['releasever'], 'basearch': self.db.conf.substitutions['basearch']}

def _obtain_mappings_yum(self):
yb = yum.YumBase()
return {'releasever': yb.conf.yumvar['releasever'], 'basearch': yb.conf.yumvar['basearch']}
return {'releasever': self.yb.conf.yumvar['releasever'], 'basearch': self.yb.conf.yumvar['basearch']}


class EnabledReposProfile(object):
Expand Down