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.
reviewable/pr18780/r1
Rene Moser 9 years ago
parent 648ff9b856
commit 6bd40787ce

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