Merge pull request #983 from ssssam/sam/authorized-keys-crash-fix
Fix authorized_key module crashing when given an invalid key
This commit is contained in:
commit
d8ab661d0a
1 changed files with 4 additions and 3 deletions
|
@ -377,13 +377,14 @@ def enforce_state(module, params):
|
|||
# Check our new keys, if any of them exist we'll continue.
|
||||
for new_key in key:
|
||||
parsed_new_key = parsekey(module, new_key)
|
||||
if key_options is not None:
|
||||
parsed_options = parseoptions(module, key_options)
|
||||
parsed_new_key = (parsed_new_key[0], parsed_new_key[1], parsed_options, parsed_new_key[3])
|
||||
|
||||
if not parsed_new_key:
|
||||
module.fail_json(msg="invalid key specified: %s" % new_key)
|
||||
|
||||
if key_options is not None:
|
||||
parsed_options = parseoptions(module, key_options)
|
||||
parsed_new_key = (parsed_new_key[0], parsed_new_key[1], parsed_options, parsed_new_key[3])
|
||||
|
||||
present = False
|
||||
matched = False
|
||||
non_matching_keys = []
|
||||
|
|
Loading…
Reference in a new issue