Commit 4484ba8a by Michael DeHaan

Merge pull request #4553 from mmoya/features

Do key validation only when key is provided
parents 64809451 2592b2c3
......@@ -188,11 +188,12 @@ def main():
state = module.params['state']
changed = False
try:
_ = int(key_id, 16)
key_id = key_id.lstrip('0x')
except ValueError:
module.fail_json("Invalid key_id")
if key_id:
try:
_ = int(key_id, 16)
key_id = key_id.lstrip('0x')
except ValueError:
module.fail_json("Invalid key_id")
# FIXME: I think we have a common facility for this, if not, want
check_missing_binaries(module)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment