2021-01-08 13:41:50 +01:00
|
|
|
From 1cea7d065d8da7c713af8136162c21187d5186f5 Mon Sep 17 00:00:00 2001
|
2020-10-14 17:29:00 +02:00
|
|
|
From: Cedric Bosdonnat <cbosdonnat@suse.com>
|
|
|
|
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
|
2021-01-08 13:41:50 +01:00
|
|
|
index 8e2180608a..e3960a5a90 100644
|
2020-10-14 17:29:00 +02:00
|
|
|
--- a/salt/modules/virt.py
|
|
|
|
+++ b/salt/modules/virt.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -2738,6 +2738,7 @@ def update(
|
2020-10-14 17:29:00 +02:00
|
|
|
]
|
|
|
|
|
2021-01-08 13:41:50 +01:00
|
|
|
data = {k: v for k, v in locals().items() if bool(v)}
|
2020-10-14 17:29:00 +02:00
|
|
|
+ data["stop_on_reboot"] = stop_on_reboot
|
|
|
|
if boot_dev:
|
|
|
|
data["boot_dev"] = {i + 1: dev for i, dev in enumerate(boot_dev.split())}
|
2021-01-08 13:41:50 +01:00
|
|
|
need_update = (
|
2020-10-14 17:29:00 +02:00
|
|
|
diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py
|
2021-01-08 13:41:50 +01:00
|
|
|
index fba821ea53..83152eda6e 100644
|
2020-10-14 17:29:00 +02:00
|
|
|
--- a/tests/unit/modules/test_virt.py
|
|
|
|
+++ b/tests/unit/modules/test_virt.py
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -1777,6 +1777,7 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin):
|
2020-10-14 17:29:00 +02:00
|
|
|
<memory unit='KiB'>1048576</memory>
|
|
|
|
<currentMemory unit='KiB'>1048576</currentMemory>
|
|
|
|
<vcpu placement='auto'>1</vcpu>
|
|
|
|
+ <on_reboot>restart</on_reboot>
|
|
|
|
<os>
|
|
|
|
<type arch='x86_64' machine='pc-i440fx-2.6'>hvm</type>
|
|
|
|
<boot dev="hd"/>
|
2021-01-08 13:41:50 +01:00
|
|
|
@@ -2349,6 +2350,7 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin):
|
2020-10-14 17:29:00 +02:00
|
|
|
<memory unit='KiB'>1048576</memory>
|
|
|
|
<currentMemory unit='KiB'>1048576</currentMemory>
|
|
|
|
<vcpu placement='auto'>1</vcpu>
|
|
|
|
+ <on_reboot>restart</on_reboot>
|
|
|
|
<os>
|
|
|
|
<type arch='x86_64' machine='pc-i440fx-2.6'>hvm</type>
|
|
|
|
</os>
|
|
|
|
--
|
2021-01-08 13:41:50 +01:00
|
|
|
2.29.2
|
2020-10-14 17:29:00 +02:00
|
|
|
|
|
|
|
|