diff --git a/engine/onstor_it_test.go b/engine/onstor_it_test.go index 1d1bb38b6..ba36eb0d8 100644 --- a/engine/onstor_it_test.go +++ b/engine/onstor_it_test.go @@ -924,9 +924,9 @@ func testOnStorITCRUDDestination(t *testing.T) { } else if !reflect.DeepEqual(dst, rcv) { t.Errorf("Expecting: %v, received: %v", dst, rcv) } - //FixMe if err = onStor.RemoveDestination(dst.Id, utils.NonTransactional); err != nil { - // t.Error(err) - // } + if err = onStor.RemoveDestination(dst.Id, utils.NonTransactional); err != nil { + t.Error(err) + } // if _, rcvErr := onStor.GetDestination(dst.Id, true, utils.NonTransactional); rcvErr != utils.ErrNotFound { // t.Error(rcvErr) // } diff --git a/engine/storage_mongo_datadb.go b/engine/storage_mongo_datadb.go index bf7ae591d..b2e381da3 100644 --- a/engine/storage_mongo_datadb.go +++ b/engine/storage_mongo_datadb.go @@ -922,9 +922,12 @@ func (ms *MongoStorage) RemoveDestination(destID string, transactionID string) ( // get destination for prefix list d, err := ms.GetDestination(destID, false, transactionID) if err != nil { + if err == mgo.ErrNotFound { + err = nil + } return } - err = col.Remove(bson.M{"key": key}) + err = col.Remove(bson.M{"key": destID}) if err != nil { return err }