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:
parent
648ff9b856
commit
6bd40787ce
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue