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.
pull/18777/head
Rene Moser 9 years ago committed by Matt Clay
parent d705647873
commit d3b680e1c9

@ -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

Loading…
Cancel
Save