Esempio n. 1
0
def _raise_for_all_others(error, match, engine_name, is_disconnect):
    LOG.exception(_LE('DB exception wrapped.'))
    raise exception.DBError(error)
Esempio n. 2
0
 def update(self):
     raise db_exception.DBError(
         inner_exception=exc.IntegrityError('a', 'a', 'a'))
Esempio n. 3
0
def _raise_savepoints_as_dberrors(error, match, engine_name, is_disconnect):
    # NOTE(rpodolyaka): this is a special case of an OperationalError that used
    # to be an InternalError. It's expected to be wrapped into oslo.db error.
    raise exception.DBError(error)
 def __init__(self):
     self._cell_data_sync = mock.Mock()
     self._cell_data_sync.side_effect = [db_exc.DBError(), []]
     super(TestCellStateManagerDB, self).__init__()
Esempio n. 5
0
    def test_add_datasource_db_error(self, add_ds):
        add_ds.side_effect = db_exc.DBError('Error in db.')

        req = self._get_datasource_request()
        self.assertRaises(congressException.DatasourceCreationError,
                          self.ds_manager.add_datasource, req)
Esempio n. 6
0
def _raise_for_all_others(error, match, engine_name, is_disconnect):
    LOG.warn('DB exception wrapped.', exc_info=True)
    raise exception.DBError(error)
Esempio n. 7
0
 def fake_db_disassociate_all(context, id):
     if id == 'Trouble':
         raise db_exc.DBError()
     pass
Esempio n. 8
0
 def fake_db_update(context, specs_id, values):
     raise db_exc.DBError()
Esempio n. 9
0
 def fake_db_disassociate(context, id, type_id):
     if id == 'Trouble':
         raise db_exc.DBError()
     elif type_id == 'NotFound':
         raise exception.VolumeTypeNotFound(volume_type_id=type_id)
     pass
Esempio n. 10
0
 def fake_db_disassociate(context, id, type_id):
     raise db_exc.DBError()
Esempio n. 11
0
 def test_create_port_catch_db_error(self):
     self._test__port_action_with_failures(exc=db_exc.DBError(),
                                           action='create_port')
Esempio n. 12
0
 def test_translates_DBerror_inner_exception(self):
     with testtools.ExpectedException(db_exc.RetryRequest):
         with db_api.exc_to_retry(ValueError):
             raise db_exc.DBError(ValueError())
Esempio n. 13
0
 def test_mysql_savepoint_error(self):
     e = db_exc.DBError("(pymysql.err.InternalError) (1305, u'SAVEPOINT "
                        "sa_savepoint_1 does not exist')")
     self.assertIsNone(self._decorated_function(1, e))