Exemplo n.º 1
0
 def setUp(self, mock_rpc):
     super(NotificationAPITestCase, self).setUp()
     self.notification_api = ha_api.NotificationAPI()
     self.req = fakes.HTTPRequest.blank('/v1/notifications',
                                        use_admin_context=True)
     self.context = self.req.environ['masakari.context']
     self.host = fakes_data.create_fake_host(
         name="host_1",
         id=1,
         reserved=False,
         on_maintenance=False,
         type="fake",
         control_attributes="fake-control_attributes",
         uuid=uuidsentinel.fake_host_1,
         failover_segment_id=uuidsentinel.fake_segment1)
     self.notification = fakes_data.create_fake_notification(
         type="VM",
         id=1,
         payload={
             'event': 'STOPPED',
             'host_status': 'NORMAL',
             'cluster_status': 'ONLINE'
         },
         source_host_uuid=uuidsentinel.fake_host,
         generated_time=NOW,
         status="running",
         notification_uuid=uuidsentinel.fake_notification)
Exemplo n.º 2
0
 def setUp(self, mock_rpc):
     super(NotificationAPITestCase, self).setUp()
     self.notification_api = ha_api.NotificationAPI()
     self.req = fakes.HTTPRequest.blank('/v1/notifications',
                                        use_admin_context=True)
     self.context = self.req.environ['masakari.context']
     self.failover_segment = fakes_data.create_fake_failover_segment(
         name="segment1",
         id=1,
         description="something",
         service_type="COMPUTE",
         recovery_method="auto",
         uuid=uuidsentinel.fake_segment)
     self.host = fakes_data.create_fake_host(
         name="host_1",
         id=1,
         reserved=False,
         on_maintenance=False,
         type="fake",
         control_attributes="fake-control_attributes",
         uuid=uuidsentinel.fake_host_1)
     self.notification = fakes_data.create_fake_notification(
         type="VM",
         id=1,
         payload={
             'event': 'STOPPED',
             'host_status': 'NORMAL',
             'cluster_status': 'ONLINE'
         },
         source_host_uuid=uuidsentinel.fake_host,
         generated_time=NOW,
         status="running",
         notification_uuid=uuidsentinel.fake_notification)
     self.exception_duplicate = exception.DuplicateNotification(
         host='host_1', type='COMPUTE_HOST')
Exemplo n.º 3
0
 def __init__(self):
     self.api = notification_api.NotificationAPI()