docs: def get_ssh_settings(application_name, user=None):
      """Retrieve the known host entries and public keys for application
  
      Retrieve the known host entries and public keys for application for all
      units of the given application related to this application for the
      app + user combination.
  
      :param application_name: Name of application eg nova-compute-something
      :type application_name: str
      :param user: The user that the ssh asserts are for.
      :type user: str
      :returns: Public keys + host keys for all units for app + user combination.
      :rtype: dict
      """
      settings = {}
      keys = {}
      prefix = ''
      if user:
          prefix = '{}_'.format(user)
  
      for i, line in enumerate(ssh_known_hosts_lines(
              application_name=application_name, user=user)):
          settings['{}known_hosts_{}'.format(prefix, i)] = line
      if settings:
          settings['{}known_hosts_max_index'.format(prefix)] = len(
              settings.keys())
  
      for i, line in enumerate(ssh_authorized_keys_lines(
              application_name=application_name, user=user)):
          keys['{}authorized_keys_{}'.format(prefix, i)] = line
      if keys:
          keys['{}authorized_keys_max_index'.format(prefix)] = len(keys.keys())
      settings.update(keys)
      return settings