From a0ebf60dea0ed290ff18d5f494478f63c8e79e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= Date: Tue, 3 Sep 2019 21:44:53 +0200 Subject: [PATCH] ovirt_vm add linux boot param warning backport (#60581) * ovirt_vm add linux boot param warning (#60474) * ovirt_vm add kernel param check * update check * update docs phrase * use douple quotes * add changelog --- .../60581-ovirt-vm-add-linux-boot-param-warning.yml | 3 +++ lib/ansible/modules/cloud/ovirt/ovirt_vm.py | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 changelogs/fragments/60581-ovirt-vm-add-linux-boot-param-warning.yml diff --git a/changelogs/fragments/60581-ovirt-vm-add-linux-boot-param-warning.yml b/changelogs/fragments/60581-ovirt-vm-add-linux-boot-param-warning.yml new file mode 100644 index 00000000000..444f74b6af0 --- /dev/null +++ b/changelogs/fragments/60581-ovirt-vm-add-linux-boot-param-warning.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - ovirt_vm - add warning message about linux boot params - they will not be suported since oVirt 4.4 (https://bugzilla.redhat.com/1732437) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py index 7fe3ca60f0b..91efe845593 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_vm.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_vm.py @@ -1186,6 +1186,7 @@ from ansible.module_utils.ovirt import ( search_by_attributes, search_by_name, wait, + engine_supported, ) @@ -2139,6 +2140,15 @@ def import_vm(module, connection): return True +def check_deprecated_params(module, connection): + if engine_supported(connection, '4.4') and \ + (module.params.get('kernel_params_persist') is not None or + module.params.get('kernel_path') is not None or + module.params.get('initrd_path') is not None or + module.params.get('kernel_params') is not None): + module.warn("Parameters 'kernel_params_persist', 'kernel_path', 'initrd_path', 'kernel_params' are not supported since oVirt 4.4.") + + def control_state(vm, vms_service, module): if vm is None: return @@ -2284,6 +2294,7 @@ def main(): state = module.params['state'] auth = module.params.pop('auth') connection = create_connection(auth) + check_deprecated_params(module, connection) vms_service = connection.system_service().vms_service() vms_module = VmsModule( connection=connection,