parameters: (self)
return_statement: return selected_target, True, ""
docstring: FIND TARGET
  
          The purpose of the snippet below is electing the first right that match
          the login AND device AND service that have been passed in the
          connection string.
          If service is blank take the first right that match login AND device
          (may happen with a command line or a mstsc '.rdp' file connections ;
          never happens if the selector is used).
          NB : service names are supposed to be in alphabetical ascending order.
docstring_summary: FIND TARGET
docstring_tokens: FIND TARGET
function: def select_target(self):
          """
          FIND TARGET
  
          The purpose of the snippet below is electing the first right that match
          the login AND device AND service that have been passed in the
          connection string.
          If service is blank take the first right that match login AND device
          (may happen with a command line or a mstsc '.rdp' file connections ;
          never happens if the selector is used).
          NB : service names are supposed to be in alphabetical ascending order.
          """
          selected_target = None
          target_device = self.shared.get(u'target_device')
          target_login = self.shared.get(u'target_login')
          target_service = (
              self.target_service_name if self.target_service_name != u'INTERNAL'
              else u'RDP'
          )
          target_group = self.target_group
  
          Logger().info("selected target ==> %s %s %s" % (
              target_login, target_device, target_service)
          )
          selected_target = self.engine.get_selected_target(target_login,
                                                            target_device,
                                                            target_service,
                                                            target_group,
                                                            self.target_context)
          if not selected_target:
              _target = u"%s@%s:%s (%s)" % (
                  target_login, target_device, target_service, target_group)
              _error_log = TR(u"Target %s not found in user rights") % _target
              _status, _error = False, _error_log
              self.rdplog.log("TARGET_ERROR",
                              target=target_login,
                              reason="Target not found in user rights")
              Logger().info("%s" % _error)
              return None, _status, _error
          return selected_target, True, ""
function_tokens: def select_target ( self ) : selected_target = None target_device = self . shared . get ( u'target_device' ) target_login = self . shared . get ( u'target_login' ) target_service = ( self . target_service_name if self . target_service_name != u'INTERNAL' else u'RDP' ) target_group = self . target_group Logger ( ) . info ( "selected target ==> %s %s %s" % ( target_login , target_device , target_service ) ) selected_target = self . engine . get_selected_target ( target_login , target_device , target_service , target_group , self . target_context ) if not selected_target : _target = u"%s@%s:%s (%s)" % ( target_login , target_device , target_service , target_group ) _error_log = TR ( u"Target %s not found in user rights" ) % _target _status , _error = False , _error_log self . rdplog . log ( "TARGET_ERROR" , target = target_login , reason = "Target not found in user rights" ) Logger ( ) . info ( "%s" % _error ) return None , _status , _error return selected_target , True , ""