mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
ovirt_vms: Raise proper error when template isn't found (#30306)
This commit is contained in:
parent
04f0b5adca
commit
70f221d57a
1 changed files with 8 additions and 2 deletions
|
@ -599,7 +599,13 @@ class VmsModule(BaseModule):
|
|||
t for t in templates
|
||||
if t.version.version_number == self.param('template_version')
|
||||
]
|
||||
if templates:
|
||||
if not templates:
|
||||
raise ValueError(
|
||||
"Template with name '%s' and version '%s' was not found'" % (
|
||||
self.param('template'),
|
||||
self.param('template_version')
|
||||
)
|
||||
)
|
||||
template = templates[0]
|
||||
|
||||
return template
|
||||
|
|
Loading…
Reference in a new issue