From bad860ad460574b78be026c0aed57f4bcfccc504 Mon Sep 17 00:00:00 2001 From: Nijin Ashok Date: Wed, 12 Jun 2019 14:11:51 +0530 Subject: [PATCH] ovirt_vm: Fix issue in resetting the storage domain lease (#57469) Currently, there is no way to remove the lease. The patch allows to reset it by passing an empty string ('') to lease. --- .../fragments/ovirt_fix_issue_in_resseting_sd_lease.yaml | 2 ++ lib/ansible/modules/cloud/ovirt/ovirt_vm.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/ovirt_fix_issue_in_resseting_sd_lease.yaml diff --git a/changelogs/fragments/ovirt_fix_issue_in_resseting_sd_lease.yaml b/changelogs/fragments/ovirt_fix_issue_in_resseting_sd_lease.yaml new file mode 100644 index 00000000000..549b0bc2540 --- /dev/null +++ b/changelogs/fragments/ovirt_fix_issue_in_resseting_sd_lease.yaml @@ -0,0 +1,2 @@ +bugfixes: + - Fix issue in resetting the storage domain lease in ovirt_vm module. diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py index 247051b50da..4afd92bec71 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py @@ -262,7 +262,7 @@ options: version_added: "2.5" lease: description: - - Name of the storage domain this virtual machine lease reside on. + - Name of the storage domain this virtual machine lease reside on. Pass an empty string to remove the lease. - NOTE - Supported since oVirt 4.1. version_added: "2.4" custom_compatibility_version: @@ -1296,7 +1296,7 @@ class VmsModule(BaseModule): id=get_id_by_name( service=self._connection.system_service().storage_domains_service(), name=self.param('lease') - ) + ) if self.param('lease') else None ) ) if self.param('lease') is not None else None, cpu=otypes.Cpu(