code: def collect_authed_hosts(peer_interface):
      '''Iterate through the units on peer interface to find all that
      have the calling host in its authorized hosts list'''
      hosts = []
      for r_id in (relation_ids(peer_interface) or []):
          for unit in related_units(r_id):
              private_addr = relation_get('private-address',
                                          rid=r_id, unit=unit)
              authed_hosts = relation_get('ssh_authorized_hosts',
                                          rid=r_id, unit=unit)
  
              if not authed_hosts:
                  log('Peer %s has not authorized *any* hosts yet, skipping.' %
                      (unit), level=INFO)
                  continue
  
              if unit_private_ip() in authed_hosts.split(':'):
                  hosts.append(private_addr)
              else:
                  log('Peer %s has not authorized *this* host yet, skipping.' %
                      (unit), level=INFO)
      return hostf collect_authed_hosts(peer_interface):
      '''Iterate through the units on peer interface to find all that
      have the calling host in its authorized hosts list'''
      hosts = []
      for r_id in (relation_ids(peer_interface) or []):
          for unit in related_units(r_id):
              private_addr = relation_get('private-address',
                                          rid=r_id, unit=unit)
              authed_hosts = relation_get('ssh_authorized_hosts',
                                          rid=r_id, unit=unit)
  
              if not authed_hosts:
                  log('Peer %s has not authorized *any* hosts yet, skipping.' %
                      (unit), level=INFO)
                  continue
  
              if unit_private_ip() in authed_hosts.split(':'):
                  hosts.append(private_addr)
              else:
                  log('Peer %s has not authorized *this* host yet, skipping.' %
                      (unit), level=INFO)
      return hosts
docs: Iterate through the units on peer interface to find all that
      have the calling host in its authorized hosts list