From 65fd331cb54c84e3bac6fd0ab6b757ee08fdd3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= Date: Tue, 8 Oct 2019 16:03:44 +0200 Subject: [PATCH] Ovirt add template timeout error (#63199) * Ovirt add template timeout error * correct example syntax --- lib/ansible/modules/cloud/ovirt/ovirt_template.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_template.py b/lib/ansible/modules/cloud/ovirt/ovirt_template.py index d885d882376..e2026362c20 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_template.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_template.py @@ -376,11 +376,11 @@ EXAMPLES = ''' # Import template - ovirt_template: - state: imported - name: mytemplate - export_domain: myexport - storage_domain: mystorage - cluster: mycluster + state: imported + name: mytemplate + export_domain: myexport + storage_domain: mystorage + cluster: mycluster # Remove template - ovirt_template: @@ -1022,6 +1022,8 @@ def main(): template = templates_module.wait_for_import( condition=lambda t: t.status == otypes.TemplateStatus.OK ) + if template is None: + raise TimeoutError("Image/template '%s' could not be imported. Try again with larger timeout." % template_name) ret = templates_module.create(result_state=otypes.TemplateStatus.OK) ret = { 'changed': True,