From ba8228ff3446729f9761b808ce8c1866bc0a6e68 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Mon, 12 Jan 2015 01:14:42 +0200 Subject: rz_kernel: return: a tuple containing the input diff and the result of it's commit --- src/server/rz_kernel.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/server/rz_kernel.py') diff --git a/src/server/rz_kernel.py b/src/server/rz_kernel.py index 41106ba5..925ebeaf 100644 --- a/src/server/rz_kernel.py +++ b/src/server/rz_kernel.py @@ -1,12 +1,14 @@ """ Rhizi kernel, home to core operation login """ -import db_controller import logging import traceback + +import db_controller from db_op import DBO_diff_commit__attr from db_op import DBO_diff_commit__topo + log = logging.getLogger('rhizi') class RZ_Kernel(object): @@ -17,21 +19,31 @@ class RZ_Kernel(object): - RESP API calls - socket.io calls - future interfaces + + @return: a tuple containing the input diff and the result of it's commit """ op = DBO_diff_commit__topo(topo_diff) try: op_ret = self.db_ctl.exec_op(op) - return op_ret + return topo_diff, op_ret except Exception as e: log.error(e.message) log.error(traceback.print_exc()) raise e def diff_commit__attr(self, attr_diff): + """ + commit a graph attribute diff - this is a common pathway for: + - RESP API calls + - socket.io calls + - future interfaces + + @return: a tuple containing the input diff and the result of it's commit + """ op = DBO_diff_commit__attr(attr_diff) try: op_ret = self.db_ctl.exec_op(op) - return op_ret + return attr_diff, op_ret except Exception as e: log.error(e.message) log.error(traceback.print_exc()) -- cgit v1.3.1