parameters: (self, msg)
docstring: Do real work with message
          msg.get_action() shoult contain XXXX.YYYYYY
          with XXXX in [test, condition, parameter]
          YYYYY in [list, new, etc ...]
docstring_summary: Do real work with message
          msg.get_action() shoult contain XXXX.YYYYYY
          with XXXX in [test, condition, parameter]
          YYYYY in [list, new, etc ...]
docstring_tokens: Do real work with message msg . get_action () shoult contain XXXX . YYYYYY with XXXX in [ test condition parameter ] YYYYY in [ list new etc ... ]
function: def on_mdp_request(self, msg):
          """ Do real work with message
          msg.get_action() shoult contain XXXX.YYYYYY
          with XXXX in [test, condition, parameter]
          YYYYY in [list, new, etc ...]
          """
          mapping = {'test':
                      {
                          'list': self._backend.list_tests,
                      },
                      'scenario':
                      {
                          'list': self._backend.list_conditions,
                          'new': self._backend.create_scenario,
                          'update': self._backend.update_scenario,
                          'delete': self._backend.del_scenario,
                          'get': self._backend.get_parsed_condition,
                          'evaluate': self._backend.eval_condition,
                          'enable': self._backend.enable_scenario,
                          'disable': self._backend.disable_scenario,
                          'test': self._backend.test_scenario
                      },
                      'action':
                      {
                          'list': self._backend.list_actions,
                      }
                  }
          try:
              if msg.get_action().split('.')[0] not in mapping.keys():
                  self._mdp_reply(msg.get_action(), {"status" : "error", "details": "{0} not in {1}".format(msg.get_action().split('.')[0], mapping.keys())})
              else:
                  if msg.get_action().split('.')[1] not in mapping[msg.get_action().split('.')[0]].keys():
                      self._mdp_reply(msg.get_action(), {"status" : "error", "details": "{0} not in {1}".format(msg.get_action().split('.')[1], mapping[msg.get_action().split('.')[0]].keys())})
                  else:
                      if msg.get_data() == {}:
                          payload = mapping[msg.get_action().split('.')[0]][msg.get_action().split('.')[1]]()
                      else:
                          payload = mapping[msg.get_action().split('.')[0]][msg.get_action().split('.')[1]](**msg.get_data())
                      self._mdp_reply(msg.get_action(), payload)
          except:
              self.log.error(u"Exception occured during message processing.")
              trace = str(traceback.format_exc())
              self.log.debug(trace)
              self._mdp_reply(msg.get_action(), {"status": "errpr", "details": trace})
function_tokens: def on_mdp_request ( self , msg ) : mapping = { 'test' : { 'list' : self . _backend . list_tests , } , 'scenario' : { 'list' : self . _backend . list_conditions , 'new' : self . _backend . create_scenario , 'update' : self . _backend . update_scenario , 'delete' : self . _backend . del_scenario , 'get' : self . _backend . get_parsed_condition , 'evaluate' : self . _backend . eval_condition , 'enable' : self . _backend . enable_scenario , 'disable' : self . _backend . disable_scenario , 'test' : self . _backend . test_scenario } , 'action' : { 'list' : self . _backend . list_actions , } } try : if msg . get_action ( ) . split ( '.' ) [ 0 ] not in mapping . keys ( ) : self . _mdp_reply ( msg . get_action ( ) , { "status" : "error" , "details" : "{0} not in {1}" . format ( msg . get_action ( ) . split ( '.' ) [ 0 ] , mapping . keys ( ) ) } ) else : if msg . get_action ( ) . split ( '.' ) [ 1 ] not in mapping [ msg . get_action ( ) . split ( '.' ) [ 0 ] ] . keys ( ) : self . _mdp_reply ( msg . get_action ( ) , { "status" : "error" , "details" : "{0} not in {1}" . format ( msg . get_action ( ) . split ( '.' ) [ 1 ] , mapping [ msg . get_action ( ) . split ( '.' ) [ 0 ] ] . keys ( ) ) } ) else : if msg . get_data ( ) == { } : payload = mapping [ msg . get_action ( ) . split ( '.' ) [ 0 ] ] [ msg . get_action ( ) . split ( '.' ) [ 1 ] ] ( ) else : payload = mapping [ msg . get_action ( ) . split ( '.' ) [ 0 ] ] [ msg . get_action ( ) . split ( '.' ) [ 1 ] ] ( * * msg . get_data ( ) ) self . _mdp_reply ( msg . get_action ( ) , payload ) except : self . log . error ( u"Exception occured during message processing." ) trace = str ( traceback . format_exc ( ) ) self . log . debug ( trace ) self . _mdp_reply ( msg . get_action ( ) , { "status" : "errpr" , "details" : trace } )