From: K Sai Kiran Date: Wed, 16 Oct 2019 12:20:53 +0000 (+0530) Subject: Bug 864 - NBI publishes created key to kakfa after editing nsd/vnfd. X-Git-Tag: v7.0.0rc1~29 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F52%2F8052%2F2;p=osm%2FNBI.git Bug 864 - NBI publishes created key to kakfa after editing nsd/vnfd. Change-Id: Ib4ab08dcb3cada34bb3f95468315f37e52486fcf Signed-off-by: K Sai Kiran --- diff --git a/osm_nbi/descriptor_topics.py b/osm_nbi/descriptor_topics.py index 95ced0d..58efa55 100644 --- a/osm_nbi/descriptor_topics.py +++ b/osm_nbi/descriptor_topics.py @@ -139,6 +139,7 @@ class DescriptorTopic(BaseTopic): self.format_on_new(content, session["project_id"], make_public=session["public"]) _id = self.db.create(self.topic, content) rollback.append({"topic": self.topic, "_id": _id}) + self._send_msg("created", {"_id": _id}) return _id, None except ValidationError as e: raise EngineException(e, HTTPStatus.UNPROCESSABLE_ENTITY) @@ -284,7 +285,7 @@ class DescriptorTopic(BaseTopic): self.fs.dir_rename(temp_folder, _id) indata["_id"] = _id - self._send_msg("created", indata) + self._send_msg("edited", indata) # TODO if descriptor has changed because kwargs update content and remove cached zip # TODO if zip is not present creates one