示例#1
0
 def run_cmd(self, payload):
     host = payload['host']
     request = ObjectDict(host=host)
     request.track = ObjectDict(host=host)
     uri = urlparse(payload['cmd'])
     cmd = uri.path
     if cmd == 'delete/module':
         result = delete_module(request, parse_qs(uri.query)['name'])
         log.debug('result: {0}'.format(result))
     else:
         raise HTTPServerError(
             title="command '{0}' is not supported".format(cmd))
     log.info('background processed command: {0}'.format(payload['cmd']))
示例#2
0
 def run_cmd(self, payload):
     host = payload['host']
     request = ObjectDict(host=host)
     request.track = ObjectDict(host=host)
     uri = urlparse(payload['cmd'])
     cmd = uri.path
     if cmd == 'delete/module':
         result = delete_module(request, parse_qs(uri.query)['name'])
         log.debug('result: {0}'.format(result))
     else:
         raise HTTPServerError(title="command '{0}' is not supported".format(
             cmd))
     log.info('background processed command: {0}'.format(payload['cmd']))