-
-
Save mhrivnak/4980483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sync_repo(self, repo, sync_conduit, config): | |
metadata = _fetch_repo_metadata(repo, config) | |
new_units = _resolve_units_to_download(metadata, sync_conduit) | |
def _fetch_repo_metadata(repo, config): | |
""" | |
Retrieves the listing of Puppet modules at the configured 'feed' location. | |
:return: list of modules in the external repository | |
:rtype: list | |
""" | |
# Stub method | |
def _resolve_units_to_download(metadata, sync_conduit): | |
""" | |
Analyzes the metadata describing modules in the external repository against those already in | |
the Pulp repository. The conduit is used to query the Pulp server for the repository's modules. | |
:return: list of modules that need to be downloaded from the external repository | |
:rtype: list | |
""" | |
# Units currently in the repository | |
module_criteria = UnitAssociationCriteria(type_ids='puppet_module') | |
existing_units = self.sync_conduit.get_units(criteria=module_criteria) | |
# Calculate the difference between existing_units and what is in the metadata |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment