unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 2f74e48a82c719c0e8aecdc067dc367790eed3f8 1648 bytes (raw)
name: packages/patches/ganeti-pyyaml-compat.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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)

debug log:

solving 2f74e48a82c719c0e8aecdc067dc367790eed3f8 ...
found 2f74e48a82c719c0e8aecdc067dc367790eed3f8 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).