Exemple #1
0
 def create(self):
     if self.obj_attr_is_set('id'):
         raise exception.ObjectActionError(action='create',
                                           reason=_('already created'))
     updates = self.smaug_obj_get_changes()
     db_operation_log = db.operation_log_create(self._context, updates)
     self._from_db_object(self._context, self, db_operation_log)
Exemple #2
0
 def create(self):
     if self.obj_attr_is_set('id'):
         raise exception.ObjectActionError(action='create',
                                           reason=_('already created'))
     updates = self.smaug_obj_get_changes()
     db_operation_log = db.operation_log_create(self._context, updates)
     self._from_db_object(self._context, self, db_operation_log)
Exemple #3
0
 def test_operation_log_update(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     db.operation_log_update(self.ctxt, operation_log['id'],
                             {'state': 'finished'})
     operation_log = db.operation_log_get(self.ctxt, operation_log['id'])
     self.assertEqual('finished', operation_log['state'])
Exemple #4
0
 def test_operation_log_update(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     db.operation_log_update(self.ctxt, operation_log['id'],
                             {'state': 'finished'})
     operation_log = db.operation_log_get(self.ctxt, operation_log['id'])
     self.assertEqual('finished', operation_log['state'])
Exemple #5
0
 def test_operation_log_destroy(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     db.operation_log_destroy(self.ctxt, operation_log['id'])
     self.assertRaises(exception.OperationLogNotFound, db.operation_log_get,
                       self.ctxt, operation_log['id'])
Exemple #6
0
 def test_operation_log_get(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     self._assertEqualObjects(operation_log, db.operation_log_get(
         self.ctxt, operation_log['id']))
Exemple #7
0
 def test_operation_log_create(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     self.assertTrue(uuidutils.is_uuid_like(operation_log['id']))
     self.assertEqual('failed', operation_log.state)
Exemple #8
0
 def test_operation_log_destroy(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     db.operation_log_destroy(self.ctxt, operation_log['id'])
     self.assertRaises(exception.OperationLogNotFound, db.operation_log_get,
                       self.ctxt, operation_log['id'])
Exemple #9
0
 def test_operation_log_get(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     self._assertEqualObjects(
         operation_log, db.operation_log_get(self.ctxt,
                                             operation_log['id']))
Exemple #10
0
 def test_operation_log_create(self):
     operation_log = db.operation_log_create(self.ctxt,
                                             self.fake_operation_log)
     self.assertTrue(uuidutils.is_uuid_like(operation_log['id']))
     self.assertEqual('failed', operation_log.state)