Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Aug 8, 2024
1 parent 752175a commit 01b888e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/rhsm/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from rhsm import ourjson as json
from rhsm.utils import suppress_output
from rhsm.repofile import get_repo_file_classes
from rhsm.repofile import YumRepoFile
from cloud_what import provider

try:
Expand Down Expand Up @@ -201,12 +202,17 @@ class EnabledReposProfile:
Collect information about enabled repositories
"""

def __init__(self, repo_file: str = REPOSITORY_PATH) -> None:
def __init__(self, repo_file: Optional[str] = None) -> None:

Check warning on line 205 in src/rhsm/profile.py

View workflow job for this annotation

GitHub Actions / black & flake8 & rpmlint

F821 undefined name 'Optional'
self._content = []
for repo_file_cls, _ in get_repo_file_classes():
repo_file = repo_file_cls()
repo_file.read()
self._content.extend(repo_file.enabled_repos())

if repo_file is not None:
yum_repo_file = YumRepoFile(repo_file).read()
self._content.extend(yum_repo_file.enabled_repos())
else:
for repo_file_cls, _ in get_repo_file_classes():
repo_file = repo_file_cls()
repo_file.read()
self._content.extend(repo_file.enabled_repos())
self._content.sort(key=lambda x: x["baseurl"])

def __eq__(self, other: "EnabledReposProfile") -> bool:
Expand Down

0 comments on commit 01b888e

Please sign in to comment.