Renamed RemSupplierProfile to RemoveSupplierProfile

This commit is contained in:
Anevo
2018-03-07 08:47:37 -05:00
parent 60c9a8661f
commit 0516168877
5 changed files with 7 additions and 6 deletions

View File

@@ -1339,13 +1339,13 @@ func testV1FIdxRemoveSupplierProfile(t *testing.T) {
if reply2 != utils.OK {
t.Errorf("Error: %+v", reply2)
}
if err := tFIdxRpc.Call("ApierV1.RemSupplierProfile",
if err := tFIdxRpc.Call("ApierV1.RemoveSupplierProfile",
&utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE1"}, &resp); err != nil {
t.Error(err)
} else if resp != utils.OK {
t.Error("Unexpected reply returned", resp)
}
if err := tFIdxRpc.Call("ApierV1.RemSupplierProfile",
if err := tFIdxRpc.Call("ApierV1.RemoveSupplierProfile",
&utils.TenantID{Tenant: tenant, ID: "TEST_PROFILE2"}, &resp); err != nil {
t.Error(err)
} else if resp != utils.OK {

View File

@@ -51,8 +51,8 @@ func (apierV1 *ApierV1) SetSupplierProfile(spp *engine.SupplierProfile, reply *s
return nil
}
//RemSupplierProfile remove a specific Supplier configuration
func (apierV1 *ApierV1) RemSupplierProfile(arg utils.TenantID, reply *string) error {
//RemoveSupplierProfile remove a specific Supplier configuration
func (apierV1 *ApierV1) RemoveSupplierProfile(arg utils.TenantID, reply *string) error {
if missing := utils.MissingStructFields(&arg, []string{"Tenant", "ID"}); len(missing) != 0 { //Params missing
return utils.NewErrMandatoryIeMissing(missing...)
}

View File

@@ -357,7 +357,7 @@ func testV1SplSUpdateSupplierProfiles(t *testing.T) {
func testV1SplSRemSupplierProfiles(t *testing.T) {
var resp string
if err := splSv1Rpc.Call("ApierV1.RemSupplierProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil {
if err := splSv1Rpc.Call("ApierV1.RemoveSupplierProfile", &utils.TenantID{Tenant: "cgrates.org", ID: "TEST_PROFILE1"}, &resp); err != nil {
t.Error(err)
} else if resp != utils.OK {
t.Error("Unexpected reply returned", resp)

View File

@@ -23,7 +23,7 @@ import "github.com/cgrates/cgrates/utils"
func init() {
c := &CmdRemoveSupplier{
name: "supplier_remove",
rpcMethod: "ApierV1.RemSupplierProfile",
rpcMethod: "ApierV1.RemoveSupplierProfile",
rpcParams: &utils.TenantID{},
}
commands[c.Name()] = c

View File

@@ -2253,6 +2253,7 @@ func (ms *MongoStorage) SetThresholdProfileDrv(tp *ThresholdProfile) (err error)
func (ms *MongoStorage) RemThresholdProfileDrv(tenant, id string) (err error) {
session, col := ms.conn(colTps)
defer session.Close()
utils.Logger.Debug(fmt.Sprintf("dbKey %+v", session))
err = col.Remove(bson.M{"tenant": tenant, "id": id})
if err != nil {
return err