Don't remove the key if its not there (or was already removed)

This commit is contained in:
Joshua Harlow
2012-06-29 13:46:19 -07:00
parent d1c711d825
commit 2282aeb6b8

View File

@@ -197,7 +197,8 @@ def update_authorized_keys(fname, keys):
# Replace it with our better one
ent = k
# Don't add it later
to_add.remove(k)
if k in to_add:
to_add.remove(k)
entries[i] = ent
# Now append any entries we did not match above