self.db.del_one(self.topic, filter_q)
self.delete_extra(session, _id, item_content, not_send_msg=not_send_msg)
self._send_msg("deleted", {"_id": _id}, not_send_msg=not_send_msg)
- return None
+ return _id
def edit(self, session, _id, indata=None, kwargs=None, content=None):
"""
self.detach(session, _id, profile_type="infra_controller_profiles")
# To delete the infra controller profile
super().delete(session, _id, not_send_msg=not_send_msg)
- return
+ return _id
class InfraConfTopic(BaseTopic):
self.detach(session, _id, profile_type="infra_config_profiles")
# To delete the infra config profile
super().delete(session, _id, not_send_msg=not_send_msg)
- return
+ return _id
class AppTopic(BaseTopic):
self.detach(session, _id, profile_type="app_profiles")
# To delete the app profile
super().delete(session, _id, not_send_msg=not_send_msg)
- return
+ return _id
class ResourceTopic(BaseTopic):
def __init__(self, db, fs, msg, auth):
BaseTopic.__init__(self, db, fs, msg, auth)
- # self.logger = logging.getLogger("nbi.k8s_topics")
def new(self, rollback, session, indata=None, kwargs=None, headers=None):
# To create the new resource profile
self.detach(session, _id, profile_type="resource_profiles")
# To delete the resource profile
super().delete(session, _id, not_send_msg=not_send_msg)
- return
+ return _id
class K8sTopic(BaseTopic):
data = {"ksus_list": _id_list, "operation_id": op_id}
self._send_msg("edit", data)
- return op_id
def edit_ksu(self, session, _id, op_id, indata, kwargs):
content = None
self._send_msg(
"delete", {"oka_id": _id, "operation_id": op_id}, not_send_msg=not_send_msg
)
+ return op_id
def new(self, rollback, session, indata=None, kwargs=None, headers=None):
# _remove_envelop
engine_session, engine_topic, _id, None, kwargs
)
if indata:
- if indata.get("name") or indata.get("description"):
+ if isinstance(indata, dict):
op_id = self.engine.edit_item(
engine_session, engine_topic, _id, indata, kwargs
)