Hello community,

here is the log from the commit of package salt for openSUSE:Factory checked in 
at 2019-07-26 12:23:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/salt (Old)
 and      /work/SRC/openSUSE:Factory/.salt.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "salt"

Fri Jul 26 12:23:53 2019 rev:90 rq:716016 version:2019.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/salt/salt.changes        2019-07-08 
15:01:57.966619933 +0200
+++ /work/SRC/openSUSE:Factory/.salt.new.4126/salt.changes      2019-07-26 
12:23:58.354469300 +0200
@@ -1,0 +2,16 @@
+Wed Jul 10 08:54:28 UTC 2019 - Pablo Suárez Hernández 
<pablo.suarezhernan...@suse.com>
+
+- virt.volume_infos: don't raise an error if there is no VM
+
+- Added:
+  * virt-1.volume_infos-fix-for-single-vm.patch
+
+-------------------------------------------------------------------
+Mon Jul  8 14:22:58 UTC 2019 - Pablo Suárez Hernández 
<pablo.suarezhernan...@suse.com>
+
+- Prevent ansiblegate unit tests to fail on Ubuntu
+
+- Added:
+  * prevent-ansiblegate-unit-tests-to-fail-on-ubuntu.patch
+
+-------------------------------------------------------------------

New:
----
  prevent-ansiblegate-unit-tests-to-fail-on-ubuntu.patch
  virt-1.volume_infos-fix-for-single-vm.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ salt.spec ++++++
--- /var/tmp/diff_new_pack.b6YonN/_old  2019-07-26 12:24:00.226468575 +0200
+++ /var/tmp/diff_new_pack.b6YonN/_new  2019-07-26 12:24:00.230468574 +0200
@@ -202,6 +202,10 @@
 Patch67:       do-not-make-ansiblegate-to-crash-on-python3-minions.patch
 # PATCH_FIX_UPSTREAM: https://github.com/saltstack/salt/pull/53693
 Patch68:       allow-passing-kwargs-to-pkg.list_downloaded-bsc-1140.patch
+# PATCH_FIX_UPSTREAM: https://github.com/saltstack/salt/pull/53661
+Patch69:       prevent-ansiblegate-unit-tests-to-fail-on-ubuntu.patch
+# PATCH_FIX_UPSTREAM: https://github.com/saltstack/salt/pull/53755
+Patch70:       virt-1.volume_infos-fix-for-single-vm.patch
 
 # BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -740,6 +744,8 @@
 %patch66 -p1
 %patch67 -p1
 %patch68 -p1
+%patch69 -p1
+%patch70 -p1
 
 %build
 %if 0%{?build_py2}

++++++ _lastrevision ++++++
--- /var/tmp/diff_new_pack.b6YonN/_old  2019-07-26 12:24:00.278468555 +0200
+++ /var/tmp/diff_new_pack.b6YonN/_new  2019-07-26 12:24:00.282468554 +0200
@@ -1 +1 @@
-0ae10b837a49c10246690aabc972d2cb02bb75de
\ No newline at end of file
+760cec648ef1960ceba0c6f265dc821a2aa1f536
\ No newline at end of file

++++++ prevent-ansiblegate-unit-tests-to-fail-on-ubuntu.patch ++++++
>From 84e9371399b50618765038bcec2e313a006eadf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
 <psuarezhernan...@suse.com>
Date: Mon, 8 Jul 2019 14:46:10 +0100
Subject: [PATCH] Prevent ansiblegate unit tests to fail on Ubuntu

---
 tests/unit/modules/test_ansiblegate.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/unit/modules/test_ansiblegate.py 
b/tests/unit/modules/test_ansiblegate.py
index 70b47f8bc2..2a24d6f147 100644
--- a/tests/unit/modules/test_ansiblegate.py
+++ b/tests/unit/modules/test_ansiblegate.py
@@ -172,9 +172,11 @@ description:
             with patch('salt.utils.timed_subprocess.TimedProc', proc):
                 ret = _ansible_module_caller.call("one.two.three", "arg_1", 
kwarg1="foobar")
                 if six.PY3:
-                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": 
{"kwarg1": "foobar", "_raw_params": "arg_1"}}'], stdout=-1, timeout=1200)
                     proc.assert_any_call(['python3', 'foofile'], 
stdin=ANSIBLE_MODULE_ARGS, stdout=-1, timeout=1200)
                 else:
-                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": 
{"_raw_params": "arg_1", "kwarg1": "foobar"}}'], stdout=-1, timeout=1200)
                     proc.assert_any_call(['python', 'foofile'], 
stdin=ANSIBLE_MODULE_ARGS, stdout=-1, timeout=1200)
+                try:
+                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": 
{"kwarg1": "foobar", "_raw_params": "arg_1"}}'], stdout=-1, timeout=1200)
+                except AssertionError:
+                    proc.assert_any_call(['echo', '{"ANSIBLE_MODULE_ARGS": 
{"_raw_params": "arg_1", "kwarg1": "foobar"}}'], stdout=-1, timeout=1200)
                 assert ret == {"completed": True, "timeout": 1200}
-- 
2.21.0


++++++ virt-1.volume_infos-fix-for-single-vm.patch ++++++
>From 9fcf9a768d0f11e04e145612cc5b2c05cfbf5378 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdon...@suse.com>
Date: Thu, 4 Apr 2019 16:18:58 +0200
Subject: [PATCH] virt.volume_infos fix for single VM

virt.volume_infos: don't raise an error if there is no VM
---
 salt/modules/virt.py            |  8 ++++--
 tests/unit/modules/test_virt.py | 46 +++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/salt/modules/virt.py b/salt/modules/virt.py
index d160f0905f..953064cc2c 100644
--- a/salt/modules/virt.py
+++ b/salt/modules/virt.py
@@ -5050,8 +5050,12 @@ def volume_infos(pool=None, volume=None, **kwargs):
     conn = __get_conn(**kwargs)
     try:
         backing_stores = _get_all_volumes_paths(conn)
-        domains = _get_domain(conn)
-        domains_list = domains if isinstance(domains, list) else [domains]
+        try:
+            domains = _get_domain(conn)
+            domains_list = domains if isinstance(domains, list) else [domains]
+        except CommandExecutionError:
+            # Having no VM is not an error here.
+            domains_list = []
         disks = {domain.name():
                  {node.get('file') for node
                   in 
ElementTree.fromstring(domain.XMLDesc(0)).findall('.//disk/source/[@file]')}
diff --git a/tests/unit/modules/test_virt.py b/tests/unit/modules/test_virt.py
index cc62b67918..b343b9bc31 100644
--- a/tests/unit/modules/test_virt.py
+++ b/tests/unit/modules/test_virt.py
@@ -2910,6 +2910,52 @@ class VirtTestCase(TestCase, LoaderModuleMockMixin):
                 }
             })
 
+        # No VM test
+        with patch('salt.modules.virt._get_domain', 
MagicMock(side_effect=CommandExecutionError('no VM'))):
+            actual = virt.volume_infos('pool0', 'vol0')
+            self.assertEqual(1, len(actual.keys()))
+            self.assertEqual(1, len(actual['pool0'].keys()))
+            self.assertEqual([], sorted(actual['pool0']['vol0']['used_by']))
+            self.assertEqual('/path/to/vol0.qcow2', 
actual['pool0']['vol0']['path'])
+            self.assertEqual('file', actual['pool0']['vol0']['type'])
+            self.assertEqual('/key/of/vol0', actual['pool0']['vol0']['key'])
+            self.assertEqual(123456789, actual['pool0']['vol0']['capacity'])
+            self.assertEqual(123456, actual['pool0']['vol0']['allocation'])
+
+            self.assertEqual(virt.volume_infos('pool1', None), {
+                'pool1': {
+                    'vol1': {
+                        'type': 'file',
+                        'key': '/key/of/vol1',
+                        'path': '/path/to/vol1.qcow2',
+                        'capacity': 12345,
+                        'allocation': 1234,
+                        'used_by': [],
+                    },
+                    'vol2': {
+                        'type': 'file',
+                        'key': '/key/of/vol2',
+                        'path': '/path/to/vol2.qcow2',
+                        'capacity': 12345,
+                        'allocation': 1234,
+                        'used_by': [],
+                    }
+                }
+            })
+
+            self.assertEqual(virt.volume_infos(None, 'vol2'), {
+                'pool1': {
+                    'vol2': {
+                        'type': 'file',
+                        'key': '/key/of/vol2',
+                        'path': '/path/to/vol2.qcow2',
+                        'capacity': 12345,
+                        'allocation': 1234,
+                        'used_by': [],
+                    }
+                }
+            })
+
     def test_volume_delete(self):
         '''
         Test virt.volume_delete
-- 
2.21.0



Reply via email to