mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-14 21:01:13 +00:00
ovirt_vms: Raise proper error when template isn't found (#30306)
This commit is contained in:
@@ -599,8 +599,14 @@ class VmsModule(BaseModule):
|
||||
t for t in templates
|
||||
if t.version.version_number == self.param('template_version')
|
||||
]
|
||||
if templates:
|
||||
template = templates[0]
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user