saltstack/salt — pull request #6290 by terminalmage (2013-07-23 22:47:09+00:00)
Title: ssh_auth: detect when source file has 0 valid keys

If an improperly-formatted file is used as the source file for an
ssh_auth.present state, the state incorrectly reports that all keys in
the file are present. This is because the functions that check the
source file only return keys that need to be changed, and with no valid
keys, there is nothing to change.

This commit detects when there are no valid keys found, and reports this
in the state output.

Additionally, since one of the ways that this edge case can be triggered
is if a public key from PuTTYgen is used, instructions have been added
to the ssh_auth.present docstring explaining how to obtain the
OpenSSH-compatible public key for the corresponding private key
generated by PuTTYgen.

Fixes #6277.