pcs/bz2210855-01-fix-resource-move-regression.patch
Michal Pospisil aa4f1fd980 Resolves: rhbz#2210855
- Fixed a regression causing crash in `pcs resource move` command (broken since pcs-0.11.5)
2023-05-31 12:04:47 +02:00

65 lines
2.2 KiB
Diff

From 835939b80f3e75616eb585bb1e17dec0a6083a88 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Tue, 30 May 2023 13:07:47 +0200
Subject: [PATCH] fix resource move regression
---
CHANGELOG.md | 3 +++
pcs/lib/pacemaker/live.py | 5 ++++-
pcs_test/tools/custom_mock.py | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c7661929..0c56758c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -27,6 +27,8 @@
Pacemaker-2.1.5-rc1 ([rhbz#2177996])
- Make `pcs resource disable --simulate --brief` documentation clearer
([rhbz#2109852])
+- Fixed a regression causing crash in `pcs resource move` command (broken since
+ pcs-0.11.5) ([rhbz#2210855])
### Changed
- Commands for displaying cluster configuration have been slightly updated:
@@ -50,6 +52,7 @@
[rhbz#2175881]: https://bugzilla.redhat.com/show_bug.cgi?id=2175881
[rhbz#2177996]: https://bugzilla.redhat.com/show_bug.cgi?id=2177996
[rhbz#2179388]: https://bugzilla.redhat.com/show_bug.cgi?id=2179388
+[rhbz#2210855]: https://bugzilla.redhat.com/show_bug.cgi?id=2210855
## [0.11.5] - 2023-03-01
diff --git a/pcs/lib/pacemaker/live.py b/pcs/lib/pacemaker/live.py
index c2ba5d60..5a4bfec2 100644
--- a/pcs/lib/pacemaker/live.py
+++ b/pcs/lib/pacemaker/live.py
@@ -384,7 +384,10 @@ def simulate_cib_xml(runner, cib_xml):
string cib_xml -- CIB XML to simulate
"""
try:
- with tools.get_tmp_file() as new_cib_file, tools.get_tmp_file() as transitions_file:
+ with (
+ tools.get_tmp_file(None) as new_cib_file,
+ tools.get_tmp_file(None) as transitions_file,
+ ):
cmd = [
__exec("crm_simulate"),
"--simulate",
diff --git a/pcs_test/tools/custom_mock.py b/pcs_test/tools/custom_mock.py
index 9380afce..90f12abd 100644
--- a/pcs_test/tools/custom_mock.py
+++ b/pcs_test/tools/custom_mock.py
@@ -101,7 +101,7 @@ class TmpFileMock:
except StopIteration:
pass
- def _mock_side_effect(self, data=None, binary=False):
+ def _mock_side_effect(self, data, binary=False):
def _seek_callback(offset):
if offset != 0:
raise AssertionError(
--
2.40.1