diff --git a/osm_nbi/k8s_topics.py b/osm_nbi/k8s_topics.py index 9519f2db0542c31621d71d0bcf1e811d136d67b9..d4ff80b6abeda676e26cba8f1d908507aae65f33 100644 --- a/osm_nbi/k8s_topics.py +++ b/osm_nbi/k8s_topics.py @@ -1038,16 +1038,24 @@ class OkaTopic(DescriptorTopic, ACMOperationTopic): ) def check_conflict_on_edit(self, session, final_content, edit_content, _id): - if ( - final_content["name"] == edit_content["name"] + if "name" in edit_content: + if final_content["name"] == edit_content["name"]: + name = edit_content["name"] + raise EngineException( + f"No update, new name for the OKA is the same: {name}", + http_code=HTTPStatus.CONFLICT, + ) + else: + self.check_unique_name(session, edit_content["name"]) + elif ( + "description" in edit_content and final_content["description"] == edit_content["description"] ): + description = edit_content["description"] raise EngineException( - "No update", + f"No update, new description for the OKA is the same: {description}", http_code=HTTPStatus.CONFLICT, ) - if final_content["name"] != edit_content["name"]: - self.check_unique_name(session, edit_content["name"]) return final_content def edit(self, session, _id, indata=None, kwargs=None, content=None):