import booth-1.0-199.1.ac1d34c.git.el8

This commit is contained in:
CentOS Sources 2021-05-18 02:54:43 -04:00 committed by Andrew Lukoshko
parent 7f189d6f86
commit cffb1725c9
4 changed files with 104 additions and 29 deletions

View File

@ -1 +1 @@
4813ede4a6bb517564a3b9f6fe523164a7362c5b SOURCES/booth-ac1d34c.tar.gz
4813ede4a6bb517564a3b9f6fe523164a7362c5b SOURCES/booth-1.0-199-ac1d34c.tar.gz

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/booth-ac1d34c.tar.gz
SOURCES/booth-1.0-199-ac1d34c.tar.gz

View File

@ -0,0 +1,57 @@
From bb58699a47a7b9070d555490f980c33caa3066e9 Mon Sep 17 00:00:00 2001
From: Jan Friesse <jfriesse@redhat.com>
Date: Mon, 8 Jun 2020 15:38:06 +0200
Subject: [PATCH] pacemaker: Handle updated exit code of crm_ticket
crm_ticket included since Pacemaker version 2.0.0-rc2 doesn't return
EPERM (1) error code any longer when ticket is updated without using
--force. Instead new value CRM_EX_INSUFFICIENT_PRIV (4) is used.
This return value is used in the test_atomicity function which is
failing with new enough Pacemaker.
Solution is to check also for return code 4.
Also previously when unexpected code is returned, log contained full
return value as returned by system call. This is not very readable so
use only exit status (WEXITSTATUS) instead.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
---
src/pacemaker.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pacemaker.c b/src/pacemaker.c
index 7e3f9e6..1582fa8 100644
--- a/src/pacemaker.c
+++ b/src/pacemaker.c
@@ -59,6 +59,7 @@ enum atomic_ticket_supported atomicity = UNKNOWN;
* - the old version asks for "Y/N" via STDIN, and returns 0
* when reading "no";
* - the new version just reports an error without asking.
+ * Since 2.0.0-rc2 error code is changed from 1 (EPERM) to 4 (CRM_EX_INSUFFICIENT_PRIV)
*/
static void test_atomicity(void)
{
@@ -86,7 +87,8 @@ static void test_atomicity(void)
log_info("Old \"crm_ticket\" found, using non-atomic ticket updates.");
break;
- case 1:
+ case 1: /* Pacemaker < 2.0.0-rc2 - EPERM */
+ case 4: /* Pacemaker >= 2.0.0-rc2 - CRM_EX_INSUFFICIENT_PRIV */
atomicity = YES;
log_info("New \"crm_ticket\" found, using atomic ticket updates.");
break;
@@ -94,7 +96,7 @@ static void test_atomicity(void)
default:
log_error("Unexpected return value from \"crm_ticket\" (%d), "
"falling back to non-atomic ticket updates.",
- rv);
+ WEXITSTATUS(rv));
atomicity = NO;
}
--
2.18.2

View File

@ -21,6 +21,23 @@
%bcond_with html_man
%bcond_with glue
%bcond_with run_build_tests
# set following to the result of `git describe --abbrev=128 $commit`
# This will be used to fill booth_ver, booth_numcomm and booth_sha1.
# It is important to keep abbrev to get full length sha1! When updating source use
# `spectool -g booth.spec` to download source.
%global git_describe_str v1.0-199-gac1d34ce172678a8f5ba415e976cf2366d45e15e
# Set this to 1 when rebasing (changing git_describe_str) and increase otherwise
%global release 1
# Run shell script to parse git_describe str into version, numcomm and sha1 hash
%global booth_ver %(s=%{git_describe_str}; vver=${s%%%%-*}; echo ${vver:1})
%global booth_numcomm %(s=%{git_describe_str}; t=${s#*-}; echo ${t%%%%-*})
%global booth_sha1 %(s=%{git_describe_str}; t=${s##*-}; echo ${t:1})
%global booth_short_sha1 %(s=%{booth_sha1}; echo ${s:0:7})
%global booth_archive_name %{name}-%{booth_ver}-%{booth_numcomm}-%{booth_short_sha1}
## User and group to use for nonprivileged services (should be in sync with pacemaker)
%global uname hacluster
@ -29,30 +46,8 @@
# Disable automatic compilation of Python files in extra directories
%global _python_bytecompile_extra 0
%global specver 6
%global boothver 1.0
# set following to the actual commit or, for final release, concatenate
# "boothver" macro to "v" (will yield a tag per the convention)
%global commit ac1d34ce172678a8f5ba415e976cf2366d45e15e
%global lparen (
%global rparen )
%global shortcommit %(c=%{commit}; case ${c} in
v*%{rparen} echo ${c:1};;
*%{rparen} echo ${c:0:7};; esac)
%global pre_release %(s=%{shortcommit}; [ ${s: -3:2} != rc ]; echo $?)
%global post_release %([ %{commit} = v%{shortcommit} ]; echo $?)
%global github_owner ClusterLabs
%if 0%{pre_release}
%global boothrel 0.%{specver}.%(s=%{shortcommit}; echo ${s: -3})
%else
%if 0%{post_release}
%global boothrel %{specver}.%{shortcommit}.git
%else
%global boothrel %{specver}
%endif
%endif
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}}
# https://fedoraproject.org/wiki/EPEL:Packaging?rd=Packaging:EPEL#The_.25license_tag
%{!?_licensedir:%global license %doc}
@ -60,13 +55,14 @@
%global test_path %{_datadir}/booth/tests
Name: booth
Version: %{boothver}
Release: %{boothrel}%{?dist}.2
Version: %{booth_ver}
Release: %{booth_numcomm}.%{release}.%{booth_short_sha1}.git%{?dist}
Summary: Ticket Manager for Multi-site Clusters
License: GPLv2+
Url: https://github.com/%{github_owner}/%{name}
Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
Source0: https://github.com/%{github_owner}/%{name}/archive/%{booth_short_sha1}/%{booth_archive_name}.tar.gz
Patch0: 0001-build-Do-not-link-with-pcmk-libraries.patch
Patch1: 0002-pacemaker-Handle-updated-exit-code-of-crm_ticket.patch
# direct build process dependencies
BuildRequires: autoconf
@ -102,8 +98,10 @@ BuildRequires: sed
BuildRequires: systemd
## for autosetup
BuildRequires: git
%if 0%{?with_run_build_tests}
# check scriptlet (for perl and netstat)
BuildRequires: perl-interpreter net-tools
%endif
# this is for a composite-requiring-its-components arranged
# as an empty package (empty files section) requiring subpackages
@ -191,7 +189,7 @@ Automated tests for running Booth, ticket manager for multi-site clusters.
# BUILD #
%prep
%autosetup -n %{name}-%{commit} -S git_am
%autosetup -n %{name}-%{booth_sha1} -S git_am
%build
./autogen.sh
@ -199,7 +197,7 @@ Automated tests for running Booth, ticket manager for multi-site clusters.
--with-initddir=%{_initrddir} \
--docdir=%{_pkgdocdir} \
--enable-user-flags \
%{!?with_html_man:--without-html_man} \
%{?with_html_man:--with-html_man} \
%{!?with_glue:--without-glue} \
PYTHON=%{__python3}
%{make_build}
@ -246,7 +244,9 @@ sed -e 's#PYTHON_SHEBANG#%{__python3} -Es#g' \
%check
# alternatively: test/runtests.py
%if 0%{?with_run_build_tests}
VERBOSE=1 make check
%endif
%files core
%license COPYING
@ -264,6 +264,12 @@ VERBOSE=1 make check
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/booth/
%dir %attr (750, %{uname}, %{gname}) %{_var}/lib/booth/cores
# Generated html docs
%if 0%{?with_html_man}
%{_pkgdocdir}/booth-keygen.8.html
%{_pkgdocdir}/boothd.8.html
%endif
%files arbitrator
%{_unitdir}/booth@.service
%{_unitdir}/booth-arbitrator.service
@ -284,6 +290,11 @@ VERBOSE=1 make check
%dir %{_datadir}/booth
%{_datadir}/booth/service-runnable
# Generated html docs
%if 0%{?with_html_man}
%{_pkgdocdir}/geostore.8.html
%endif
%files test
%doc %{_pkgdocdir}/README-testing
# /usr/share/booth provided by -site
@ -292,6 +303,13 @@ VERBOSE=1 make check
%{_usr}/lib/ocf/resource.d/booth/sharedrsc
%changelog
* Thu Oct 15 2020 Jan Friesse <jfriesse@redhat.com> - 1.0-199.1.ac1d34c.git
- Resolves: rhbz#1873948
- Resolves: rhbz#1768172
- Fix versioning scheme to handle updates better
- Handle updated exit code of crm_ticket
* Wed Jun 3 2020 Jan Friesse <jfriesse@redhat.com> - 1.0-6.ac1d34c.git.2
- Related: rhbz#1835831