From: Swaraj Kumar Date: Tue, 4 Feb 2025 02:58:04 +0000 (+0530) Subject: Error message update X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=6c6e152cfcafc8b96fac3dec912c1bf9a3a7d29a;p=aiml-fw%2Fawmf%2Ftm.git Error message update Change-Id: I94c2b5677bf7de4230317defcaa63dd0e45264c3 Signed-off-by: Swaraj Kumar --- diff --git a/tests/test_trainingjob_controller.py b/tests/test_trainingjob_controller.py index a7aa34e..80545a3 100644 --- a/tests/test_trainingjob_controller.py +++ b/tests/test_trainingjob_controller.py @@ -97,7 +97,7 @@ class Test_create_trainingjob: @patch('trainingmgr.controller.trainingjob_controller.get_modelinfo_by_modelId_service', return_value = None) def test_create_trainingjob_model_not_registered(self, mock1): trainingmgr_main.LOGGER.debug("******* test_create_trainingjob_model_not_registered *******") - expected_data = "modelId test_model and 1 is not registered at MME, Please first register at MME and then continue" + expected_data = "Model name = test_model and Model version = 1 is not registered at MME, Please first register at MME and then continue" trainingjob_req = { "modelId":{ "modelname": "test_model", @@ -129,7 +129,7 @@ class Test_create_trainingjob: @patch('trainingmgr.controller.trainingjob_controller.get_modelinfo_by_modelId_service', return_value=registered_model_list) def test_create_trainingjob_model_location_mismatch(self, mock1): trainingmgr_main.LOGGER.debug("******* test_create_trainingjob_model_location_mismatch *******") - expected_data = "modelId test_model and 1 and trainingjob created does not have same modelLocation, Please first register at MME properly and then continue" + expected_data = "Model name = test_model and Model version = 1 and trainingjob created does not have same modelLocation, Please first register at MME properly and then continue" trainingjob_req = { "modelId":{ "modelname": "test_model", diff --git a/trainingmgr/controller/trainingjob_controller.py b/trainingmgr/controller/trainingjob_controller.py index 5c9dfd7..1676277 100644 --- a/trainingmgr/controller/trainingjob_controller.py +++ b/trainingmgr/controller/trainingjob_controller.py @@ -79,11 +79,11 @@ def create_trainingjob(): registered_model_list = get_modelinfo_by_modelId_service(model_id.modelname, model_id.modelversion) # Verify if the modelId is registered over mme or not if registered_model_list is None: - return jsonify({"Exception":f"modelId {model_id.modelname} and {model_id.modelversion} is not registered at MME, Please first register at MME and then continue"}), status.HTTP_400_BAD_REQUEST + return jsonify({"Exception":f"Model name = {model_id.modelname} and Model version = {model_id.modelversion} is not registered at MME, Please first register at MME and then continue"}), status.HTTP_400_BAD_REQUEST registered_model_dict = registered_model_list[0] if registered_model_dict["modelLocation"] != trainingjob.model_location: - return jsonify({"Exception":f"modelId {model_id.modelname} and {model_id.modelversion} and trainingjob created does not have same modelLocation, Please first register at MME properly and then continue"}), status.HTTP_400_BAD_REQUEST + return jsonify({"Exception":f"Model name = {model_id.modelname} and Model version = {model_id.modelversion} and trainingjob created does not have same modelLocation, Please first register at MME properly and then continue"}), status.HTTP_400_BAD_REQUEST return create_training_job(trainingjob=trainingjob, registered_model_dict= registered_model_dict)