def create(self):
        if self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='create',
                                              reason=_('already created'))

        updates = self.karbor_obj_get_changes()
        db_state = db.scheduled_operation_state_create(self._context, updates)
        self._from_db_object(self._context, self, db_state)
Esempio n. 2
0
 def _create_scheduled_operation_state(self):
     values = {
         'operation_id': '0354ca9ddcd046b693340d78759fd274',
         'service_id': 1,
         'trust_id': '123',
         'state': 'init',
     }
     return db.scheduled_operation_state_create(self.ctxt, values)
    def create(self):
        if self.obj_attr_is_set('id'):
            raise exception.ObjectActionError(action='create',
                                              reason=_('already created'))

        updates = self.karbor_obj_get_changes()
        db_state = db.scheduled_operation_state_create(self._context, updates)
        self._from_db_object(self._context, self, db_state)
Esempio n. 4
0
 def _create_scheduled_operation_state(self):
     values = {
         'operation_id': '0354ca9ddcd046b693340d78759fd274',
         'service_id': 1,
         'trust_id': '123',
         'state': 'init',
     }
     return db.scheduled_operation_state_create(self.ctxt, values)