Exemplo n.º 1
0
    def setUp(self):
        super(TestGetMetadataStep, self).setUp()
        self.working_dir = tempfile.mkdtemp()
        self.repo = RepositoryModel('repo1')
        self.conduit = mock.MagicMock()
        plugin_config = {
            constants.CONFIG_KEY_UPSTREAM_NAME: 'pulp/crane',
            importer_constants.KEY_FEED: 'http://pulpproject.org/',
        }
        self.config = PluginCallConfiguration({}, plugin_config)

        self.step = v1_sync.GetMetadataStep(repo=self.repo,
                                            conduit=self.conduit,
                                            config=self.config)
        self.step.working_dir = self.working_dir
        self.step.parent = mock.MagicMock()
        self.index = self.step.parent.v1_index_repository
Exemplo n.º 2
0
    def add_v1_steps(self, repo, config):
        """
        Add v1 sync steps.

        :param repo:        repository to sync
        :type  repo:        pulp.plugins.model.Repository
        :param config:      config object for the sync
        :type  config:      pulp.plugins.config.PluginCallConfiguration
        """
        self.add_child(v1_sync.GetMetadataStep())
        # save this step so its "units_to_download" attribute can be accessed later
        self.v1_step_get_local_units = publish_step.GetLocalUnitsStep(
            constants.IMPORTER_TYPE_ID, available_units=self.v1_available_units)
        self.v1_step_get_local_units.step_id = constants.SYNC_STEP_GET_LOCAL_V1
        self.add_child(self.v1_step_get_local_units)
        self.add_child(publish_step.DownloadStep(
            constants.SYNC_STEP_DOWNLOAD_V1, downloads=self.v1_generate_download_requests(),
            repo=repo, config=config, description=_('Downloading remote files')))
        self.add_child(v1_sync.SaveImages())