From 1cea7d065d8da7c713af8136162c21187d5186f5 Mon Sep 17 00:00:00 2001 From: Cedric Bosdonnat Date: Wed, 14 Oct 2020 12:39:16 +0200 Subject: [PATCH] Ensure virt.update stop_on_reboot is updated with its default value (#280) While all virt.update properties default values should not be used when updating the XML definition, the stop_on_reboot default value (False) needs to be passed still or the user will never be able to update with this value. --- salt/modules/virt.py | 1 + tests/unit/modules/test_virt.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/salt/modules/virt.py b/salt/modules/virt.py index 8e2180608a..e3960a5a90 100644 --- a/salt/modules/virt.py +++ b/salt/modules/virt.py @@ -2738,6 +2738,7 @@ def update( ] data = {k: v for k, v in locals().items() if bool(v)} + data["stop_on_reboot"] = stop_on_reboot if boot_dev: data["boot_dev"] = {i + 1: dev for i, dev in enumerate(boot_dev.split())} need_update = ( diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py index fba821ea53..83152eda6e 100644 --- a/tests/unit/modules/test_virt.py +++ b/tests/unit/modules/test_virt.py @@ -1777,6 +1777,7 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): 1048576 1048576 1 + restart hvm @@ -2349,6 +2350,7 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin): 1048576 1048576 1 + restart hvm -- 2.29.2