File prevent-systemd-run-description-issue-when-running-a.patch of Package salt.20998

From c363b97dcddc9cb16102e5bfb9f3a9f40892704a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
 <psuarezhernandez@suse.com>
Date: Mon, 30 Sep 2019 12:06:08 +0100
Subject: [PATCH] Prevent systemd-run description issue when running
 aptpkg (bsc#1152366)

---
 salt/modules/aptpkg.py            | 2 +-
 tests/unit/modules/test_aptpkg.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py
index 658a16da4c..db0480b45d 100644
--- a/salt/modules/aptpkg.py
+++ b/salt/modules/aptpkg.py
@@ -160,7 +160,7 @@ def _call_apt(args, scope=True, **kwargs):
         and salt.utils.systemd.has_scope(__context__)
         and __salt__["config.get"]("systemd.scope", True)
     ):
-        cmd.extend(["systemd-run", "--scope", '--description "{}"'.format(__name__)])
+        cmd.extend(["systemd-run", "--scope", "--description", '"{}"'.format(__name__)])
     cmd.extend(args)
 
     params = {
diff --git a/tests/unit/modules/test_aptpkg.py b/tests/unit/modules/test_aptpkg.py
index c3769a7df1..77d8b84896 100644
--- a/tests/unit/modules/test_aptpkg.py
+++ b/tests/unit/modules/test_aptpkg.py
@@ -896,7 +896,8 @@ class AptUtilsTestCase(TestCase, LoaderModuleMockMixin):
                 [
                     "systemd-run",
                     "--scope",
-                    '--description "salt.modules.aptpkg"',
+                    "--description",
+                    '"salt.modules.aptpkg"',
                     "apt-get",
                     "purge",
                     "vim",
-- 
2.29.2


openSUSE Build Service is sponsored by