summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-04-09 12:39:45 +0200
committerMarius Bakke <marius@gnu.org>2022-04-09 14:27:43 +0200
commitdce0249f18cfdc899468cc8a1a29235e34d53030 (patch)
tree375d5c59e2b92c4463bd6e5f9d7e9fc6bf332509 /gnu
parent47b6451eb55d74161d6e5899f0079e219cfa8a00 (diff)
downloadguix-dce0249f18cfdc899468cc8a1a29235e34d53030.tar.gz
gnu: ganeti: Fix test failure with PyYAML 6.0.
This fixes a regression that was introduced in
27720d0fe14ee4cd413a6745e0782a698a011924.

* gnu/packages/patches/ganeti-pyyaml-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/virtualization.scm (ganeti)[source](patches): Add it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/ganeti-pyyaml-compat.patch41
-rw-r--r--gnu/packages/virtualization.scm1
3 files changed, 43 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index a44815bdbb..2a68d45717 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1084,6 +1084,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/ganeti-disable-version-symlinks.patch	\
   %D%/packages/patches/ganeti-haskell-compat.patch		\
   %D%/packages/patches/ganeti-haskell-pythondir.patch		\
+  %D%/packages/patches/ganeti-pyyaml-compat.patch		\
   %D%/packages/patches/ganeti-shepherd-master-failover.patch	\
   %D%/packages/patches/ganeti-shepherd-support.patch		\
   %D%/packages/patches/ganeti-sphinx-compat.patch		\
diff --git a/gnu/packages/patches/ganeti-pyyaml-compat.patch b/gnu/packages/patches/ganeti-pyyaml-compat.patch
new file mode 100644
index 0000000000..2f74e48a82
--- /dev/null
+++ b/gnu/packages/patches/ganeti-pyyaml-compat.patch
@@ -0,0 +1,41 @@
+Add Loader argument to 'yaml.load' invocations as required by PyYAML 6.0.
+
+Submitted upstream:
+
+  https://github.com/ganeti/ganeti/pull/1668
+
+diff --git a/qa/qa_utils.py b/qa/qa_utils.py
+index da485df48..27428e685 100644
+--- a/qa/qa_utils.py
++++ b/qa/qa_utils.py
+@@ -450,7 +450,7 @@ def GetObjectInfo(infocmd):
+   master = qa_config.GetMasterNode()
+   cmdline = utils.ShellQuoteArgs(infocmd)
+   info_out = GetCommandOutput(master.primary, cmdline)
+-  return yaml.load(info_out)
++  return yaml.load(info_out, Loader=yaml.SafeLoader)
+ 
+ 
+ def UploadFile(node, src):
+diff --git a/test/py/ganeti.cli_unittest.py b/test/py/ganeti.cli_unittest.py
+index 9cc980afa..242aac9fd 100755
+--- a/test/py/ganeti.cli_unittest.py
++++ b/test/py/ganeti.cli_unittest.py
+@@ -1141,14 +1141,15 @@ class TestFormatPolicyInfo(unittest.TestCase):
+           self._RenameDictItem(minmax, key, keyparts[0])
+     self.assertTrue(constants.IPOLICY_DTS in parsed)
+     parsed[constants.IPOLICY_DTS] = yaml.load("[%s]" %
+-                                              parsed[constants.IPOLICY_DTS])
++                                              parsed[constants.IPOLICY_DTS],
++                                              Loader=yaml.SafeLoader)
+ 
+   @staticmethod
+   def _PrintAndParsePolicy(custom, effective, iscluster):
+     formatted = cli.FormatPolicyInfo(custom, effective, iscluster)
+     buf = StringIO()
+     cli._SerializeGenericInfo(buf, formatted, 0)
+-    return yaml.load(buf.getvalue())
++    return yaml.load(buf.getvalue(), Loader=yaml.SafeLoader)
+ 
+   def _PrintAndCheckParsed(self, policy):
+     parsed = self._PrintAndParsePolicy(policy, NotImplemented, True)
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index a058e59f6b..1f71f079c2 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -561,6 +561,7 @@ firmware blobs.  You can
                                        "ganeti-sphinx-compat.patch"
                                        "ganeti-haskell-compat.patch"
                                        "ganeti-haskell-pythondir.patch"
+                                       "ganeti-pyyaml-compat.patch"
                                        "ganeti-disable-version-symlinks.patch"))))
     (build-system gnu-build-system)
     (arguments