diff options
author | Ludovic Courtès <ludo@gnu.org> | 2022-06-08 14:46:24 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-06-08 14:46:24 +0200 |
commit | 8c3e9da13a3c92a7db308db8c0d81cb474ad7799 (patch) | |
tree | 88d06952aa5cc3a9c4991d9c43eb7950ff174fe1 /gnu/packages/patches/ganeti-pyyaml-compat.patch | |
parent | 5439c04ebdb7b6405f5ea2446b375f1d155a8d95 (diff) | |
parent | 0c5299200ffcd16370f047b7ccb187c60f30da34 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches/ganeti-pyyaml-compat.patch')
-rw-r--r-- | gnu/packages/patches/ganeti-pyyaml-compat.patch | 41 |
1 files changed, 41 insertions, 0 deletions
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) |