code: def _GetAction(self, action, text):
      
      # TODO: replace "x in y" checks by startswith if possible.
      if 'airportdProcessDLILEvent' in action:
        interface = text.split()[0]
        return 'Interface {0:s} turn up.'.format(interface)
  
      if 'doAutoJoin' in action:
        match = self._CONNECTED_RE.match(text)
        if match:
          ssid = match.group(1)[1:-1]
        else:
          ssid = 'Unknown'
        return 'Wifi connected to SSID {0:s}'.format(ssid)
  
      if 'processSystemPSKAssoc' in action:
        wifi_parameters = self._WIFI_PARAMETERS_RE.search(text)
        if wifi_parameters:
          ssid = wifi_parameters.group(1)
          bssid = wifi_parameters.group(2)
          security = wifi_parameters.group(3)
          if not ssid:
            ssid = 'Unknown'
          if not bssid:
            bssid = 'Unknown'
          if not security:
            security = 'Unknown'
  
          return (
              'New wifi configured. BSSID: {0:s}, SSID: {1:s}, '
              'Security: {2:s}.').format(bssid, ssid, security)
  
      return text
docs: Parse the well known actions for easy reading.
  
      Args:
        action (str): the function or action called by the agent.
        text (str): mac Wifi log text.
  
      Returns:
         str: a formatted string representing the known (or common) action.
             If the action is not known the original log text is returned.