Beispiel #1
0
 def delRequestCommon(self,sid,info,methodname):
     """
     Install common method
     """
     try:
         dv = self.get_cache(sid,methodname,"vars")
         #if not dv:
             #reload(cl_install)
             #dv = cl_install.DataVarsInstall()
             #dv.importInstall()
             #dv.flIniFile()
             #initfunc(dv)
         errors = self.check_req_params(dv, info,
                    ordered=['cl_req_id'],
                    allvars=True)
         if errors:
             return errors 
         request_meth = type("delRequestCommon",(self.Common,
                             CoreWsdl, object), {})
         pid = self.startprocess(sid, target=request_meth,
                             method="del_request_meth",
                             method_name='core_del_request',
                             args_proc = (dv,))
         returnmess = ReturnedMessage(type = 'pid', message = pid)
         returnmess.type = "pid"
         returnmess.message = pid
         dv = self.clear_cache(sid,methodname)
         return [returnmess]
     finally:
         if dv:
             self.set_cache(sid,methodname,"vars",dv,smart=False)
     return []
Beispiel #2
0
 def requestCommon(self,sid,info,methodname):
     """
     Install common method
     """
     try:
         dv = self.get_cache(sid,methodname,"vars")
         if not dv:
             #reload(cl_install)
             dv = datavars.DataVarsCore()
             dv.importCore()
             dv.flIniFile()
         errors = self.check_req_params(dv, info,
                                        ordered=['cl_page_count',
                                                 'cl_page_offset'],
                                        allvars=True)
         if errors:
             return errors
         request_meth = type("requestCommon",(self.Common,
                             CoreWsdl, object), {})
         pid = self.startprocess(sid, target=request_meth,
                                 method="show_request_meth",
                                 method_name='core_show_request',
                                 auto_delete = True,
                                 args_proc = (dv,))
         returnmess = ReturnedMessage(type = 'pid', message = pid, 
                                      expert = True)
         returnmess.type = "pid"
         returnmess.message = pid
         dv = self.clear_cache(sid,methodname)
         return [returnmess]
     finally:
         if dv:
             self.set_cache(sid,methodname,"vars",dv,smart=False)
     return []
Beispiel #3
0
 def addGroupCommon(self,sid,info,methodname):
     """
     Install common method
     """
     try:
         dv = self.get_cache(sid,methodname,"vars")
         errors = self.check_group_params(dv, info,
                    ordered=['cl_group_add', 'cl_group_rights'],
                    allvars=True)
         if errors:
             return errors 
         add_group_meth = type("delGroupCommon",(self.Common,
                             CoreWsdl, object), {})
         pid = self.startprocess(sid, target=add_group_meth,
                             method="add_group_meth",
                             method_name='core_add_group',
                             args_proc = (dv,))
         returnmess = ReturnedMessage(type = 'pid', message = pid)
         returnmess.type = "pid"
         returnmess.message = pid
         dv = self.clear_cache(sid,methodname)
         return [returnmess]
     finally:
         if dv:
             self.set_cache(sid,methodname,"vars",dv,smart=False)
     return []
Beispiel #4
0
 def core_setup(self, sid, info):
     try:
         dv = self.get_cache(sid, "core_setup", "vars")
         if not dv:
             dv = self.core_setup_vars()
         else:
             dv.processRefresh()
         if info:
             checkonly = info.CheckOnly
         else:
             checkonly = False
         errors = map(lambda x: ReturnedMessage(**x), dv.checkGroups(info, allvars=not checkonly))
         if errors:
             return errors
         if checkonly:
             returnmess = ReturnedMessage(type="", message=None)
             return [returnmess]
         install_meth = type("CommonCore", (self.Common, PackageUpdater, object), {})
         pid = self.startprocess(
             sid, target=install_meth, method="updateConfig", method_name="core_setup", args_proc=(dv,)
         )
         returnmess = ReturnedMessage(type="pid", message=pid)
         returnmess.type = "pid"
         returnmess.message = pid
         dv = self.clear_cache(sid, "core_setup")
         return [returnmess]
     finally:
         if dv:
             self.set_cache(sid, "core_setup", "vars", dv, smart=False)
     return []
Beispiel #5
0
 def core_dispatch(self, sid, info):
     """
     Dispatch-conf
     """
     install_meth = self.Common
     pid = self.startprocess(
         sid, target=install_meth, method="dispatchConf", method_name="core_dispatch", args_proc=()
     )
     returnmess = ReturnedMessage(type="pid", message=pid)
     returnmess.type = "pid"
     returnmess.message = pid
     return [returnmess]