コード例 #1
0
    def test__configure_repository_protection(self, write_consumer_cert_bundle, add_protected_repo):
        repo = MagicMock()
        repo.id = 7
        cert = 'This is a real cert, trust me.'

        publish.configure_repository_protection(repo, cert)

        # Assert that the appropriate repository protection calls were made
        write_consumer_cert_bundle.assert_called_once_with(repo.id, {'ca': cert})
        add_protected_repo.assert_called_once_with(publish._get_relative_path(repo), repo.id)
コード例 #2
0
    def test__configure_repository_protection(self, write_consumer_cert_bundle,
                                              add_protected_repo):
        repo = MagicMock()
        repo.id = 7
        cert = 'This is a real cert, trust me.'

        publish.configure_repository_protection(repo, cert)

        # Assert that the appropriate repository protection calls were made
        write_consumer_cert_bundle.assert_called_once_with(
            repo.id, {'ca': cert})
        add_protected_repo.assert_called_once_with(
            publish._get_relative_path(repo), repo.id)
コード例 #3
0
ファイル: distributor.py プロジェクト: bechtoldt/pulp_rpm
    def post_repo_publish(self, repo, config):
        """
        API method that is called after the contents of a published repo have
        been moved into place on the filesystem

        :param repo: The repository that is going to be hosted
        :type repo: pulp.plugins.model.Repository
        :param config: the configuration for the repository
        :type  config: pulp.plugins.config.PluginCallConfiguration
        """
        if self._is_https_supported(config):
            authorization_ca_cert = config.get(constants.CONFIG_SSL_AUTH_CA_CERT)
            if authorization_ca_cert:
                publish.configure_repository_protection(repo, authorization_ca_cert)
コード例 #4
0
    def post_repo_publish(self, repo, config):
        """
        API method that is called after the contents of a published repo have
        been moved into place on the filesystem

        :param repo: The repository that is going to be hosted
        :type repo: pulp.server.db.model.Repository

        :param config: the configuration for the repository
        :type  config: pulp.plugins.config.PluginCallConfiguration
        """
        if self._is_https_supported(config):
            authorization_ca_cert = config.get(constants.CONFIG_SSL_AUTH_CA_CERT)
            if authorization_ca_cert:
                publish.configure_repository_protection(repo, authorization_ca_cert)