Пример #1
0
 def running_config_DELETE(self, *args):
     session_id = args[0]
     kb_session = KBSessionManager.get(session_id)
     status = kb_session.kb_status
     if status != "READY":
         response.status = 403
         response.text = u"Session can be destroyed only if it is at READY."
         return response.text
     if kb_session.kloudbuster:
         kb_session.kloudbuster.dispose()
     KBSessionManager.delete(session_id)
     return "OK!"
Пример #2
0
 def running_config_DELETE(self, *args):
     session_id = args[0]
     kb_session = KBSessionManager.get(session_id)
     status = kb_session.kb_status
     if status != "READY":
         response.status = 403
         response.text = u"Session can be destroyed only if it is at READY."
         return response.text
     if kb_session.kloudbuster:
         kb_session.kloudbuster.dispose()
     KBSessionManager.delete(session_id)
     return "OK!"
Пример #3
0
 def running_config_DELETE(self, *args):
     if len(args):
         session_id = args[0]
     else:
         response.status = 400
         response.text = u"Please specify the session_id."
         return response.text
     if KBSessionManager.has(session_id):
         kb_session = KBSessionManager.get(session_id)
         if kb_session.kloudbuster:
             kb_session.kloudbuster.dispose()
         KBSessionManager.delete(session_id)
         return "OK!"
     else:
         response.status = 404
         response.text = u"Session ID is not found or invalid."
         return response.text