Ejemplo n.º 1
0
def handle_event(notifier_config, event):
    """
    Send the event out to an AMQP broker.

    :param notifier_config: dictionary with keys 'subject', which defines the
                            subject of each email message, and 'addresses',
                            which is a list of strings that are email addresses
                            that should receive this notification.
    :type  notifier_config: dict
    :param event:   Event instance
    :type  event:   pulp.server.event.data.event
    :return: None
    """

    factory.topic_publish_manager().publish(event, notifier_config.get('exchange'))
Ejemplo n.º 2
0
    def test_syntactic_sugar_methods(self):
        """
        Tests the syntactic sugar methods for retrieving specific managers.
        """
        # Setup
        factory.initialize()

        # Test
        self.assertTrue(isinstance(factory.authentication_manager(), AuthenticationManager))
        self.assertTrue(isinstance(factory.cert_generation_manager(), CertGenerationManager))
        self.assertTrue(isinstance(factory.certificate_manager(), CertificateManager))
        self.assertTrue(isinstance(factory.password_manager(), PasswordManager))
        self.assertTrue(isinstance(factory.permission_manager(), PermissionManager))
        self.assertTrue(isinstance(factory.permission_query_manager(), PermissionQueryManager))
        self.assertTrue(isinstance(factory.role_manager(), RoleManager))
        self.assertTrue(isinstance(factory.role_query_manager(), RoleQueryManager))
        self.assertTrue(isinstance(factory.user_manager(), UserManager))
        self.assertTrue(isinstance(factory.user_query_manager(), UserQueryManager))
        self.assertTrue(isinstance(factory.repo_manager(), RepoManager))
        self.assertTrue(isinstance(factory.repo_unit_association_manager(),
                                   RepoUnitAssociationManager))
        self.assertTrue(isinstance(factory.repo_publish_manager(), RepoPublishManager))
        self.assertTrue(isinstance(factory.repo_query_manager(), RepoQueryManager))
        self.assertTrue(isinstance(factory.repo_sync_manager(), RepoSyncManager))
        self.assertTrue(isinstance(factory.content_manager(), ContentManager))
        self.assertTrue(isinstance(factory.content_query_manager(), ContentQueryManager))
        self.assertTrue(isinstance(factory.content_upload_manager(), ContentUploadManager))
        self.assertTrue(isinstance(factory.consumer_manager(), ConsumerManager))
        self.assertTrue(isinstance(factory.topic_publish_manager(), TopicPublishManager))
Ejemplo n.º 3
0
    def test_syntactic_sugar_methods(self):
        """
        Tests the syntactic sugar methods for retrieving specific managers.
        """
        # Setup
        factory.initialize()

        # Test
        self.assertTrue(
            isinstance(factory.authentication_manager(),
                       AuthenticationManager))
        self.assertTrue(
            isinstance(factory.cert_generation_manager(),
                       CertGenerationManager))
        self.assertTrue(
            isinstance(factory.certificate_manager(), CertificateManager))
        self.assertTrue(isinstance(factory.password_manager(),
                                   PasswordManager))
        self.assertTrue(
            isinstance(factory.permission_manager(), PermissionManager))
        self.assertTrue(
            isinstance(factory.permission_query_manager(),
                       PermissionQueryManager))
        self.assertTrue(isinstance(factory.role_manager(), RoleManager))
        self.assertTrue(
            isinstance(factory.role_query_manager(), RoleQueryManager))
        self.assertTrue(isinstance(factory.user_manager(), UserManager))
        self.assertTrue(
            isinstance(factory.user_query_manager(), UserQueryManager))
        self.assertTrue(
            isinstance(factory.repo_unit_association_manager(),
                       RepoUnitAssociationManager))
        self.assertTrue(isinstance(factory.content_manager(), ContentManager))
        self.assertTrue(
            isinstance(factory.content_query_manager(), ContentQueryManager))
        self.assertTrue(
            isinstance(factory.content_upload_manager(), ContentUploadManager))
        self.assertTrue(isinstance(factory.consumer_manager(),
                                   ConsumerManager))
        self.assertTrue(
            isinstance(factory.topic_publish_manager(), TopicPublishManager))