croc cloud - ec2 key patch (#60929)
This patch fixes "IndexError: list index out of range" error for https://console.cloud.croc.ru. When key pair is new, croc return dict with an empty list for key KeyPairs that causes ansible to crush.
This commit is contained in:
parent
919a9e33e8
commit
ef1fd19c00
1 changed files with 2 additions and 0 deletions
|
@ -180,6 +180,8 @@ def find_key_pair(module, ec2_client, name):
|
|||
if err.response['Error']['Code'] == "InvalidKeyPair.NotFound":
|
||||
return None
|
||||
module.fail_json_aws(err, msg="error finding keypair")
|
||||
except IndexError:
|
||||
key = None
|
||||
return key
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue