# File lib/smart_proxy_salt/salt_main.rb, line 111
    def key_list

      find_salt_binaries
      command = "#{@sudo} -u #{Proxy::Salt::Plugin.settings.salt_command_user} #{@salt_key} --finger-all --output=json"
      logger.debug "Executing #{command}"
      response = `#{command}`
      unless $? == 0
        logger.warn "Failed to run salt-key: #{response}"
        raise 'Execution of salt-key failed, check log files'
      end

      keys_hash = {}

      sk_hash = JSON.parse(response)

      accepted_minions = sk_hash['minions']
      accepted_minions.keys.each { | accepted_minion | keys_hash[accepted_minion] = { 'state' => 'accepted', 'fingerprint' => accepted_minions[accepted_minion]} } if sk_hash.key? 'minions'

      rejected_minions = sk_hash['minions_rejected']
      rejected_minions.keys.each { | rejected_minion | keys_hash[rejected_minion] = { 'state' => 'rejected', 'fingerprint' => rejected_minions[rejected_minion] } } if sk_hash.key? 'minions_rejected'

      unaccepted_minions = sk_hash['minions_pre']
      unaccepted_minions.keys.each { | unaccepted_minion | keys_hash[unaccepted_minion] = { 'state' => 'unaccepted', 'fingerprint' => unaccepted_minions[unaccepted_minion] } } if sk_hash.key? 'minions_pre'

      keys_hash

    end