Fixed crash when adding a node to a cluster

This commit is contained in:
Ivan Devat 2018-02-26 16:37:40 +01:00
parent 47f1518c67
commit 33b5b2b10a
2 changed files with 58 additions and 1 deletions

View File

@ -0,0 +1,51 @@
From 6913cef1fa9d7134689c9bdcfe177fb226d9b0d4 Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Mon, 26 Feb 2018 16:24:20 +0100
Subject: [PATCH] open corosync + pacemaker authkey in binary mode
---
pcs/cluster.py | 2 +-
pcs/lib/commands/test/remote_node/fixtures_add.py | 1 +
pcs/lib/pacemaker/env.py | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/pcs/cluster.py b/pcs/cluster.py
index 50f05f7..d7158b1 100644
--- a/pcs/cluster.py
+++ b/pcs/cluster.py
@@ -1834,7 +1834,7 @@ def node_add(lib_env, node0, node1, modifiers):
com_cmd = DistributeFiles(
lib_env.report_processor,
node_communication_format.corosync_authkey_file(
- open(settings.corosync_authkey_file).read()
+ open(settings.corosync_authkey_file, "rb").read()
),
# added force, it was missing before
# but it doesn't make sence here
diff --git a/pcs/lib/commands/test/remote_node/fixtures_add.py b/pcs/lib/commands/test/remote_node/fixtures_add.py
index 2b674b8..a4c2092 100644
--- a/pcs/lib/commands/test/remote_node/fixtures_add.py
+++ b/pcs/lib/commands/test/remote_node/fixtures_add.py
@@ -82,6 +82,7 @@ class EnvConfigMixin(object):
self.config.fs.open(
self.PCMK_AUTHKEY_PATH,
+ mode="rb",
**kwargs
)
diff --git a/pcs/lib/pacemaker/env.py b/pcs/lib/pacemaker/env.py
index 43f3b07..933bac1 100644
--- a/pcs/lib/pacemaker/env.py
+++ b/pcs/lib/pacemaker/env.py
@@ -17,6 +17,7 @@ class PacemakerEnv(object):
self.__authkey = RealFile(
file_role=env_file_role_codes.PACEMAKER_AUTHKEY,
file_path=settings.pacemaker_authkey_file,
+ is_binary=True,
)
@property
--
1.8.3.1

View File

@ -1,6 +1,6 @@
Name: pcs
Version: 0.9.163
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
URL: https://github.com/ClusterLabs/pcs
Group: System Environment/Base
@ -24,6 +24,7 @@ Source13: https://rubygems.org/downloads/sinatra-contrib-2.0.0.gem
Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}.tar.gz#/pyagentx-%{pyagentx_version}.tar.gz
Patch0: fedfix.patch
Patch1: open-corosync-pacemaker-authkey-in-binary-mode.patch
# git for patches
BuildRequires: git
@ -158,6 +159,8 @@ UpdateTimestamps() {
%patch0 -p1
UpdateTimestamps -p1 %{PATCH0}
%patch1 -p1
UpdateTimestamps -p1 %{PATCH1}
mkdir -p pcsd/.bundle
cp -f %SOURCE1 pcsd/.bundle/config
@ -340,6 +343,9 @@ end
%doc pyagentx_README.md
%changelog
* Mon Feb 26 2018 Ivan Devát <idevat@redhat.com> - 0.9.163-2
- Fixed crash when adding a node to a cluster
* Tue Feb 20 2018 Ivan Devát <idevat@redhat.com> - 0.9.163-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Adapted for Rack 2 and Sinatra 2