Пример #1
0
 def kill(self):
     """Destroy the service object in the datastore."""
     self.stop()
     try:
         db.service_destroy(context.get_admin_context(), self.service_id)
     except exception.NotFound:
         LOG.warning('Service killed that has no database entry')
Пример #2
0
 def kill(self):
     """Destroy the service object in the datastore."""
     self.stop()
     try:
         db.service_destroy(context.get_admin_context(), self.service_id)
     except exception.NotFound:
         LOG.warning(_LW('Service killed that has no database entry'))
Пример #3
0
 def test_service_disabled_on_create_based_on_flag(self):
     self.flags(enable_new_services=False)
     host = 'foo'
     binary = 'karbor-fake'
     app = service.Service.create(host=host, binary=binary)
     app.start()
     app.stop()
     ref = db.service_get(context.get_admin_context(), app.service_id)
     db.service_destroy(context.get_admin_context(), app.service_id)
     self.assertTrue(ref['disabled'])
Пример #4
0
 def test_service_disabled_on_create_based_on_flag(self):
     self.flags(enable_new_services=False)
     host = 'foo'
     binary = 'karbor-fake'
     app = service.Service.create(host=host, binary=binary)
     app.start()
     app.stop()
     ref = db.service_get(context.get_admin_context(), app.service_id)
     db.service_destroy(context.get_admin_context(), app.service_id)
     self.assertTrue(ref['disabled'])
Пример #5
0
 def test_service_destroy(self):
     service_ref = db.service_create(self.ctxt,
                                     {'host': 'hosttest2',
                                      'binary': 'binarytest2',
                                      'topic': 'topictest2',
                                      'report_count': 0})
     service_id = service_ref['id']
     db.service_destroy(self.ctxt, service_id)
     self.assertRaises(exception.ServiceNotFound, db.service_get,
                       self.ctxt, service_id)
Пример #6
0
 def test_service_destroy(self):
     service_ref = db.service_create(
         self.ctxt, {
             'host': 'hosttest2',
             'binary': 'binarytest2',
             'topic': 'topictest2',
             'report_count': 0
         })
     service_id = service_ref['id']
     db.service_destroy(self.ctxt, service_id)
     self.assertRaises(exception.ServiceNotFound, db.service_get, self.ctxt,
                       service_id)
Пример #7
0
 def destroy(self):
     with self.obj_as_admin():
         db.service_destroy(self._context, self.id)
Пример #8
0
 def destroy(self):
     with self.obj_as_admin():
         db.service_destroy(self._context, self.id)