Skip to content

Commit 1064a27

Browse files
authored
Handle template with no display text(can be optional) (#49)
1 parent 461bfb4 commit 1064a27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/modules/cs_instance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def get_template_or_iso(self, key=None):
494494
templates = self.query_api('listTemplates', **args)
495495
if templates:
496496
for t in templates:
497-
if template in [t['displaytext'], t['name'], t['id']]:
497+
if template in [t.get('displaytext', None), t['name'], t['id']]:
498498
if rootdisksize and t['size'] > rootdisksize * 1024 ** 3:
499499
continue
500500
self.template = t

0 commit comments

Comments
 (0)