Skip to content

Commit 31624f8

Browse files
committed
Use get_uuid_from_pulp_href to get repository ids
1 parent 034bef2 commit 31624f8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

alws/crud/package_info.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from alws.errors import PlatformNotFoundError, RepositoriesNotFoundError
99
from alws.models import Platform, Repository
1010
from alws.pulp_models import CoreRepositoryContent, RpmPackage
11+
from alws.utils.pulp_utils import get_uuid_from_pulp_href
1112

1213

1314
async def get_package_info(
@@ -40,7 +41,9 @@ async def get_package_info(
4041
msg = f"No repositories found for {platform_name}.{arch}"
4142
raise RepositoriesNotFoundError(msg)
4243

43-
repo_ids = [repo.pulp_href.split('/')[-2] for repo in repositories]
44+
repo_ids = [
45+
get_uuid_from_pulp_href(repo.pulp_href) for repo in repositories
46+
]
4447

4548
subq_conditions = [
4649
CoreRepositoryContent.repository_id.in_(repo_ids),
@@ -75,8 +78,4 @@ async def get_package_info(
7578
"changelogs",
7679
],
7780
)
78-
packages = []
79-
for pulp_pkg in pulp_packages:
80-
packages.append(PackageTuple(*pulp_pkg)._asdict())
81-
82-
return packages
81+
return [PackageTuple(*pulp_pkg)._asdict() for pulp_pkg in pulp_packages]

0 commit comments

Comments
 (0)