saltstack/salt — pull request #977 by trane (2012-03-20 23:32:08+00:00)
Title: Fix where re.search applied to empty lines

Move the re.search method to ensure that lines are valid ssh key lines, break
out of loop when it encounters errors. Might want to change this into exception
handling of some sort.

We have some things to think about with this fix (stuff that I didn't feel comfortable doing without knowing the salt code base better):
* we assume that the authorized_keys file is valid and only contains comment and valid ssh keys
* if there is an error, it only returns "Invalid ssh key" this is *not* optimal, should have an exception