parameters: (self)
return_statement: return peers
docstring: Returns list of wireguard peers, the result is cached.
docstring_summary: Returns list of wireguard peers, the result is cached.
docstring_tokens: Returns list of wireguard peers the result is cached .
function: def _get_wireguard_peers(self):
          """
          Returns list of wireguard peers, the result is cached.
          """
          peers = []
          for vpnclient in self._get_peer_queryset():
              if vpnclient.ip:
                  ip_address = ipaddress.ip_address(vpnclient.ip.ip_address)
                  peers.append(
                      {
                          'public_key': vpnclient.public_key,
                          'allowed_ips': f'{ip_address}/{ip_address.max_prefixlen}',
                      }
                  )
          return peers
function_tokens: def _get_wireguard_peers ( self ) : peers = [ ] for vpnclient in self . _get_peer_queryset ( ) : if vpnclient . ip : ip_address = ipaddress . ip_address ( vpnclient . ip . ip_address ) peers . append ( { 'public_key' : vpnclient . public_key , 'allowed_ips' : f'{ip_address}/{ip_address.max_prefixlen}' , } ) return peers