mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
cloudstack: fix templates not always have checksums
It is not documented but it seems only registered templates have checksums. Templates created from VMs and snapshot don't. This change fixes the traceback. But we must re-thinking, if it still makes sense to look for the checksum.
This commit is contained in:
@@ -501,7 +501,7 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
|
||||
return templates['template'][0]
|
||||
else:
|
||||
for i in templates['template']:
|
||||
if i['checksum'] == checksum:
|
||||
if 'checksum' in i and i['checksum'] == checksum:
|
||||
return i
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user