Skip to content

Commit

Permalink
Add new modular API method ModuleBase.get_modules
Browse files Browse the repository at this point in the history
Ansible is using ModuleBase._get_modules method. This patch creates new
non-private method which provides the same functionality and mark it as
an API.
  • Loading branch information
m-blaha authored and j-mracek committed Jun 27, 2019
1 parent 5a5c66d commit ba2320a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dnf/module/module_base.py
Expand Up @@ -234,8 +234,12 @@ def remove(self, module_specs):
self.base._remove_if_unneeded(query)
return no_match_specs

def get_modules(self, module_spec):
# :api
return self._get_modules(module_spec)

def _get_modules(self, module_spec):
# :api (used by ansible)
# used by ansible (lib/ansible/modules/packaging/os/dnf.py)
subj = hawkey.Subject(module_spec)
for nsvcap in subj.nsvcap_possibilities():
name = nsvcap.name if nsvcap.name else ""
Expand Down

0 comments on commit ba2320a

Please sign in to comment.