Skip to content

Commit

Permalink
Make it possible to list modules under "pulp-admin rpm content"
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed May 24, 2019
1 parent 0f5b2e7 commit 61a7539
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions extensions_admin/pulp_rpm/extensions/admin/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
TYPE_DRPM = 'drpm'
TYPE_ERRATUM = 'erratum'
TYPE_DISTRIBUTION = 'distribution'
TYPE_MODULEMD = 'modulemd'
TYPE_PACKAGE_GROUP = 'package_group'
TYPE_PACKAGE_CATEGORY = 'package_category'
TYPE_PACKAGE_ENVIRONMENT = 'package_environment'
Expand Down Expand Up @@ -128,6 +129,7 @@
'in a repository')
DESC_LANGPACKS = _('search for package langpacks in a repository')
DESC_DISTRIBUTIONS = _('list distributions in a repository')
DESC_MODULEMD = _('search for modules in a repository')
DESC_ERRATA = _('search errata in a repository')
DESC_YUM_METADATA_FILE = _('search for Yum Metadata Files in a repository')

Expand Down Expand Up @@ -296,6 +298,15 @@ def drpm(self, **kwargs):
self.run_search([TYPE_DRPM], **kwargs)


class SearchModulemdCommand(BaseSearchCommand):
def __init__(self, context):
super(SearchModulemdCommand, self).__init__(self.modulemd, context, name='modulemd',
description=DESC_MODULEMD)

def modulemd(self, **kwargs):
self.run_search([TYPE_MODULEMD], **kwargs)


class SearchPackageGroupsCommand(BaseSearchCommand):
def __init__(self, context):
super(SearchPackageGroupsCommand, self).__init__(self.package_group, context, name='group',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def initialize(context):
contents_section = structure.repo_contents_section(context.cli)
contents_section.add_command(contents.SearchRpmsCommand(context))
contents_section.add_command(contents.SearchDrpmsCommand(context))
contents_section.add_command(contents.SearchModulemdCommand(context))
contents_section.add_command(contents.SearchSrpmsCommand(context))
contents_section.add_command(contents.SearchPackageGroupsCommand(context))
contents_section.add_command(contents.SearchPackageCategoriesCommand(context))
Expand Down

0 comments on commit 61a7539

Please sign in to comment.