X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fadmin_topics.py;h=f831b6301a8ac21d3e884846af3a5778c694aaa2;hp=26c44d2c4eda81f5f1c808b2a6b4066d91a32d0f;hb=20e74d260242c91c9836efba6a9436a159c4decc;hpb=b66b041b8a3669ef44d9a94643cfa4add94d7f9b diff --git a/osm_nbi/admin_topics.py b/osm_nbi/admin_topics.py index 26c44d2..f831b63 100644 --- a/osm_nbi/admin_topics.py +++ b/osm_nbi/admin_topics.py @@ -325,14 +325,14 @@ class CommonVimWimSdn(BaseTopic): # do not remove reference, but order via kafka to delete it if session["project_id"] and session["project_id"]: other_projects_referencing = next((p for p in db_content["_admin"]["projects_read"] - if p not in session["project_id"]), None) + if p not in session["project_id"] and p != "ANY"), None) # check if there are projects referencing it (apart from ANY, that means, public).... if other_projects_referencing: # remove references but not delete - update_dict_pull = {"_admin.projects_read.{}".format(p): None for p in session["project_id"]} - update_dict_pull.update({"_admin.projects_write.{}".format(p): None for p in session["project_id"]}) - self.db.set_one(self.topic, filter_q, update_dict=None, pull=update_dict_pull) + update_dict_pull = {"_admin.projects_read": session["project_id"], + "_admin.projects_write": session["project_id"]} + self.db.set_one(self.topic, filter_q, update_dict=None, pull_list=update_dict_pull) return None else: can_write = next((p for p in db_content["_admin"]["projects_write"] if p == "ANY" or @@ -398,6 +398,7 @@ class WimAccountTopic(CommonVimWimSdn): class SdnTopic(CommonVimWimSdn): topic = "sdns" topic_msg = "sdn" + quota_name = "sdn_controllers" schema_new = sdn_new_schema schema_edit = sdn_edit_schema multiproject = True