Ejemplo n.º 1
0
 def setUp(self):
     super(TestAMQPPostgres, self).setUp()
     with mock.patch('amqp_postgres.main.config.instance',
                     self.server_configuration):
         amqp_client, _ = _create_connections()
         amqp_client.consume_in_thread()
         self.addCleanup(amqp_client.close)
         self.events_publisher = create_events_publisher()
Ejemplo n.º 2
0
 def _create_events_publisher(self):
     os.environ['AGENT_NAME'] = 'test'
     return create_events_publisher(amqp_host=self.args.amqp_hostname,
                                    amqp_user=self.args.amqp_username,
                                    amqp_pass=self.args.amqp_password,
                                    amqp_vhost='/',
                                    ssl_enabled=False,
                                    ssl_cert_path='')
 def setUp(self):
     super(TestAMQPPostgres, self).setUp()
     with mock.patch('amqp_postgres.main.config.instance',
                     self.server_configuration):
         amqp_client, _ = _create_connections()
         amqp_client.consume_in_thread()
         self.addCleanup(amqp_client.close)
         self.events_publisher = create_events_publisher()
Ejemplo n.º 4
0
def send_event(event, message_type):
    logs.populate_base_item(event, 'cloudify_event')
    events_publisher = create_events_publisher(
        amqp_host=config.instance.amqp_host,
        amqp_user=config.instance.amqp_username,
        amqp_pass=config.instance.amqp_password,
        amqp_port=BROKER_PORT_SSL,
        amqp_vhost='/',
        ssl_enabled=True,
        ssl_cert_path=config.instance.amqp_ca_path)

    events_publisher.publish_message(event, message_type)
    events_publisher.close()
Ejemplo n.º 5
0
def send_event(event, message_type):
    logs.populate_base_item(event, 'cloudify_event')
    events_publisher = create_events_publisher(
        amqp_host=config.instance.amqp_host,
        amqp_user=config.instance.amqp_username,
        amqp_pass=config.instance.amqp_password,
        amqp_port=BROKER_PORT_SSL,
        amqp_vhost='/',
        ssl_enabled=True,
        ssl_cert_path=config.instance.amqp_ca_path
    )

    events_publisher.publish_message(event, message_type)
    events_publisher.close()
Ejemplo n.º 6
0
 def setUp(self):
     super(TestAMQPPostgres, self).setUp()
     config = self.server_configuration
     config_keys = [
         'postgresql_{0}'.format(n)
         for n in ['host', 'db_name', 'username', 'password']
     ] + [
         'amqp_{0}'.format(n)
         for n in ['host', 'username', 'password', 'ca_path']
     ]
     amqp_client, _ = _create_connections(
         {k: getattr(config, k)
          for k in config_keys})
     amqp_client.consume_in_thread()
     self.addCleanup(amqp_client.close)
     self.events_publisher = create_events_publisher()
Ejemplo n.º 7
0
 def _make_client(self):
     return amqp_client.create_events_publisher(*self._client_args,
                                                **self._client_kwargs)