Rebased to latest upstream sources

This commit is contained in:
Ondrej Mular 2019-06-14 08:48:30 +02:00
parent 116232cf36
commit ca4645e212
8 changed files with 66 additions and 222 deletions

3
.gitignore vendored
View File

@ -57,3 +57,6 @@
/tilt-2.0.8.gem /tilt-2.0.8.gem
/pcs-0.10.0.alpha.6.tar.gz /pcs-0.10.0.alpha.6.tar.gz
/pcs-0.10.1.tar.gz /pcs-0.10.1.tar.gz
/pcs-0.10.2.tar.gz
/pcs-web-ui-0.1.1.tar.gz
/pcs-web-ui-node-modules-0.1.1.tar.xz

View File

@ -1,47 +0,0 @@
From 49ab32a69a3ce2b5e093b4997f01a4de9042b0b2 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Wed, 12 Dec 2018 10:15:17 +0100
Subject: [PATCH] drop removed command "pcs resource show" from help
---
pcs/pcs.8 | 4 ++--
pcs/usage.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pcs/pcs.8 b/pcs/pcs.8
index 47d0dda7..aa72aa91 100644
--- a/pcs/pcs.8
+++ b/pcs/pcs.8
@@ -961,10 +961,10 @@ Authenticate current user to local pcsd. This is requiered to run some pcs comma
.SH EXAMPLES
.TP
Show all resources
-.B # pcs resource show
+.B # pcs resource config
.TP
Show options specific to the 'VirtualIP' resource
-.B # pcs resource show VirtualIP
+.B # pcs resource config VirtualIP
.TP
Create a new resource called 'VirtualIP' with options
.B # pcs resource create VirtualIP ocf:heartbeat:IPaddr2 ip=192.168.0.99 cidr_netmask=32 nic=eth2 op monitor interval=30s
diff --git a/pcs/usage.py b/pcs/usage.py
index 21c6e486..4487d844 100644
--- a/pcs/usage.py
+++ b/pcs/usage.py
@@ -558,10 +558,10 @@ Commands:
Examples:
- pcs resource show
+ pcs resource config
Show all resources.
- pcs resource show VirtualIP
+ pcs resource config VirtualIP
Show options specific to the 'VirtualIP' resource.
--
2.17.0

View File

@ -1,40 +0,0 @@
From a6105339c18a7ac1a69f4c61d0c436c38249798a Mon Sep 17 00:00:00 2001
From: Ivan Devat <idevat@redhat.com>
Date: Tue, 17 Jul 2018 12:59:17 +0200
Subject: [PATCH 1/4] disable gui
---
pcs/daemon/run.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/pcs/daemon/run.py b/pcs/daemon/run.py
index 2b6e00ed..2d3dfbca 100644
--- a/pcs/daemon/run.py
+++ b/pcs/daemon/run.py
@@ -59,14 +59,15 @@ def configure_app(
https_server_manage,
)
- if not disable_gui:
- routes.extend(
- app_gui.get_routes(
- session_storage,
- ruby_pcsd_wrapper,
- public_dir
- )
- )
+ # gui is not prepared yet
+ # if not disable_gui:
+ # routes.extend(
+ # app_gui.get_routes(
+ # session_storage,
+ # ruby_pcsd_wrapper,
+ # public_dir
+ # )
+ # )
return Application(routes, debug=debug)
return make_app
--
2.18.0

View File

@ -1,26 +0,0 @@
From ebb9e4ac0ad43a12bfbac55537d18fc35188d870 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Tue, 2 Oct 2018 14:46:43 +0200
Subject: [PATCH 4/4] exclude test resources from python package
---
setup.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/setup.py b/setup.py
index 9d9b9851..56eb2ab8 100644
--- a/setup.py
+++ b/setup.py
@@ -28,9 +28,6 @@ setup(
'bash_completion',
'pcs.8',
'pcs',
- 'test/resources/*.xml',
- 'test/resources/*.conf',
- 'test/resources/qdevice-certs/*'
]},
zip_safe=False,
entry_points={
--
2.18.0

View File

@ -1,25 +0,0 @@
From f2fe4f03c5737130c6d20364931d993e08cbfa18 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Tue, 2 Oct 2018 09:22:10 +0200
Subject: [PATCH 2/4] exclude tests from python package
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 7aa36421..9d9b9851 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@ setup(
author='Chris Feist',
author_email='cfeist@redhat.com',
url='https://github.com/ClusterLabs/pcs',
- packages=find_packages(),
+ packages=find_packages(exclude=["*.test.*", "*.test"]),
package_data={'pcs':[
'bash_completion',
'pcs.8',
--
2.18.0

View File

@ -1,6 +1,6 @@
Name: pcs Name: pcs
Version: 0.10.1 Version: 0.10.2
Release: 4%{?dist} Release: 1%{?dist}
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses # https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPLv2: pcs # GPLv2: pcs
# ASL 2.0: tornado # ASL 2.0: tornado
@ -9,6 +9,13 @@ License: GPLv2 and ASL 2.0 and MIT
URL: https://github.com/ClusterLabs/pcs URL: https://github.com/ClusterLabs/pcs
Summary: Pacemaker Configuration System Summary: Pacemaker Configuration System
%global version_or_commit %{version}
# %%global version_or_commit f556c4adb538c8a95d763472d370f3f5d27eb38a
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.1
%global ui_src_name pcs-web-ui-%{ui_commit}
%global pcs_snmp_pkg_name pcs-snmp %global pcs_snmp_pkg_name pcs-snmp
@ -24,6 +31,7 @@ Summary: Pacemaker Configuration System
# different content in different architectures. # different content in different architectures.
%global pcs_libdir %{_prefix}/lib %global pcs_libdir %{_prefix}/lib
%global bundled_src_dir pcs/bundled %global bundled_src_dir pcs/bundled
%global pcsd_public_dir pcsd/public
%global rubygem_cache_dir pcsd/vendor/cache %global rubygem_cache_dir pcsd/vendor/cache
%global rubygem_bundle_dir pcsd/vendor/bundle/ruby %global rubygem_bundle_dir pcsd/vendor/bundle/ruby
# https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Python_bytecompilation # https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Python_bytecompilation
@ -39,7 +47,7 @@ Summary: Pacemaker Configuration System
#part after last slash is recognized as filename in look-aside repository #part after last slash is recognized as filename in look-aside repository
#desired name is achived by trick with hash anchor #desired name is achived by trick with hash anchor
Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source0: %{url}/archive/%{version_or_commit}/%{pcs_source_name}.tar.gz
Source1: pcsd-bundle-config-1 Source1: pcsd-bundle-config-1
Source11: https://rubygems.org/downloads/tilt-%{rubygem_tilt_version}.gem Source11: https://rubygems.org/downloads/tilt-%{rubygem_tilt_version}.gem
@ -47,7 +55,10 @@ Source11: https://rubygems.org/downloads/tilt-%{rubygem_tilt_version}.gem
Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}.tar.gz#/pyagentx-%{pyagentx_version}.tar.gz Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}.tar.gz#/pyagentx-%{pyagentx_version}.tar.gz
Source42: https://github.com/tornadoweb/tornado/archive/v%{tornado_version}.tar.gz#/tornado-%{tornado_version}.tar.gz Source42: https://github.com/tornadoweb/tornado/archive/v%{tornado_version}.tar.gz#/tornado-%{tornado_version}.tar.gz
Patch0: bz1656953-01-drop-removed-command-pcs-resource-show-from-help.patch Source100: https://github.com/idevat/pcs-web-ui/archive/%{ui_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/idevat/pcs-web-ui/releases/download/%{ui_commit}/pcs-web-ui-node-modules-%{ui_commit}.tar.xz
# Patch0: bz1656953-01-drop-removed-command-pcs-resource-show-from-help.patch
# git for patches # git for patches
BuildRequires: git BuildRequires: git
@ -97,6 +108,9 @@ BuildRequires: fontconfig
BuildRequires: liberation-sans-fonts BuildRequires: liberation-sans-fonts
BuildRequires: overpass-fonts BuildRequires: overpass-fonts
# for building web ui
BuildRequires: npm
# python and libraries for pcs, setuptools for pcs entrypoint # python and libraries for pcs, setuptools for pcs entrypoint
Requires: python3 >= 3.6 Requires: python3 >= 3.6
Requires: python3-lxml Requires: python3-lxml
@ -123,12 +137,15 @@ Requires: python3-pyOpenSSL
Suggests: pacemaker Suggests: pacemaker
Requires: (corosync >= 2.99 if pacemaker) Requires: (corosync >= 2.99 if pacemaker)
# pcs enables corosync encryption by default so we require libknet1-plugins-all # pcs enables corosync encryption by default so we require libknet1-plugins-all
Requires: libknet1-plugins-all Requires: (libknet1-plugins-all if corosync)
Requires: pacemaker-cli >= 2.0.0 Requires: pacemaker-cli >= 2.0.0
# for post, preun and postun macros # for post, preun and postun macros
Requires(post): systemd Requires(post): systemd
Requires(preun): systemd Requires(preun): systemd
Requires(postun): systemd Requires(postun): systemd
# pam is used for authentication inside daemon (python ctypes)
# more details: https://bugzilla.redhat.com/show_bug.cgi?id=1717113
Requires: pam
# pcsd fonts # pcsd fonts
Requires: liberation-sans-fonts Requires: liberation-sans-fonts
Requires: overpass-fonts Requires: overpass-fonts
@ -162,7 +179,7 @@ Provides: bundled(pyagentx) = %{pyagentx_version}
SNMP agent that provides information about pacemaker cluster to the master agent (snmpd) SNMP agent that provides information about pacemaker cluster to the master agent (snmpd)
%prep %prep
%autosetup -p1 -S git %autosetup -p1 -S git -n %{pcs_source_name}
# -- following is inspired by python-simplejon.el5 -- # -- following is inspired by python-simplejon.el5 --
# Update timestamps on the files touched by a patch, to avoid non-equal # Update timestamps on the files touched by a patch, to avoid non-equal
@ -199,7 +216,12 @@ update_times_patch(){
update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}` update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}`
} }
update_times_patch %{PATCH0} # update_times_patch %%{PATCH0}
# prepare dirs/files necessary for building web ui
# inside SOURCE100 is only directory %%{ui_src_name}
tar -xzf %SOURCE100 -C %{pcsd_public_dir}
tar -xf %SOURCE101 -C %{pcsd_public_dir}/%{ui_src_name}
# prepare dirs/files necessary for building all bundles # prepare dirs/files necessary for building all bundles
# ----------------------------------------------------- # -----------------------------------------------------
@ -243,6 +265,11 @@ gem install \
-i %{rubygem_bundle_dir} \ -i %{rubygem_bundle_dir} \
%{rubygem_cache_dir}/tilt-%{rubygem_tilt_version}.gem \ %{rubygem_cache_dir}/tilt-%{rubygem_tilt_version}.gem \
# build web ui and put it to pcsd
make -C %{pcsd_public_dir}/%{ui_src_name} build
mv %{pcsd_public_dir}/%{ui_src_name}/build pcsd/public/ui
rm -r %{pcsd_public_dir}/%{ui_src_name}
# main pcs install # main pcs install
make install \ make install \
DESTDIR=$RPM_BUILD_ROOT \ DESTDIR=$RPM_BUILD_ROOT \
@ -281,14 +308,12 @@ rm -r -v $RPM_BUILD_ROOT%{pcs_libdir}/%{rubygem_cache_dir}
export PYTHONCOERCECLOCALE=0 export PYTHONCOERCECLOCALE=0
run_all_tests(){ run_all_tests(){
#prepare environmet for tests
export PYTHONPATH="${PYTHONPATH}:$RPM_BUILD_ROOT%{pcs_libdir}/pcs/bundled/packages"
#run pcs tests #run pcs tests
# disabled tests: # disabled tests:
# #
%{__python3} pcs/test/suite.py -v --vanilla \ BUNDLED_LIB_LOCATION=$RPM_BUILD_ROOT%{pcs_libdir}/pcs/bundled/packages \
%{__python3} pcs_test/suite.py -v --vanilla \
# --all-but \ # --all-but \
test_result_python=$? test_result_python=$?
@ -300,11 +325,6 @@ run_all_tests(){
-I${pcsd_dir}/test \ -I${pcsd_dir}/test \
${pcsd_dir}/test/test_all_suite.rb ${pcsd_dir}/test/test_all_suite.rb
test_result_ruby=$? test_result_ruby=$?
#remove pcsd tests, we do not distribute them in the rpm
rm -r -v ${pcsd_dir}/test
# remove javascript testing files
rm -r -v ${pcsd_dir}/public/js/dev
if [ $test_result_python -ne 0 ]; then if [ $test_result_python -ne 0 ]; then
return $test_result_python return $test_result_python
@ -312,7 +332,17 @@ run_all_tests(){
return $test_result_ruby return $test_result_ruby
} }
remove_all_tests() {
pcsd_dir=$RPM_BUILD_ROOT%{pcs_libdir}/pcsd
#remove pcsd tests, we do not distribute them in the rpm
rm -r -v ${pcsd_dir}/test
# remove javascript testing files
rm -r -v ${pcsd_dir}/public/js/dev
}
run_all_tests run_all_tests
remove_all_tests
%post %post
%systemd_post pcsd.service %systemd_post pcsd.service
@ -339,7 +369,7 @@ run_all_tests
%license tornado_LICENSE %license tornado_LICENSE
%license COPYING %license COPYING
%{python3_sitelib}/pcs %{python3_sitelib}/pcs
%{python3_sitelib}/pcs-0.10.1-py3.*.egg-info %{python3_sitelib}/pcs-%{version}-py3.*.egg-info
%{_sbindir}/pcs %{_sbindir}/pcs
%{_sbindir}/pcsd %{_sbindir}/pcsd
%{pcs_libdir}/pcs/pcs_internal %{pcs_libdir}/pcs/pcs_internal
@ -353,13 +383,13 @@ run_all_tests
%dir %{_var}/log/pcsd %dir %{_var}/log/pcsd
%config(noreplace) %{_sysconfdir}/logrotate.d/pcsd %config(noreplace) %{_sysconfdir}/logrotate.d/pcsd
%config(noreplace) %{_sysconfdir}/sysconfig/pcsd %config(noreplace) %{_sysconfdir}/sysconfig/pcsd
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/cfgsync_ctl %ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/cfgsync_ctl
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/known-hosts %ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/known-hosts
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcsd.cookiesecret %ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/pcsd.cookiesecret
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcsd.crt %ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/pcsd.crt
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcsd.key %ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/pcsd.key
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcs_settings.conf %ghost %config(noreplace) %attr(0644,root,root) %{_sharedstatedir}/pcsd/pcs_settings.conf
%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcs_users.conf %ghost %config(noreplace) %attr(0644,root,root) %{_sharedstatedir}/pcsd/pcs_users.conf
%{_mandir}/man8/pcs.* %{_mandir}/man8/pcs.*
%{_mandir}/man8/pcsd.* %{_mandir}/man8/pcsd.*
%exclude %{pcs_libdir}/pcsd/*.debian %exclude %{pcs_libdir}/pcsd/*.debian
@ -388,6 +418,12 @@ run_all_tests
%license pyagentx_LICENSE.txt %license pyagentx_LICENSE.txt
%changelog %changelog
* Fri Jun 14 2019 Ondrej Mular <omular@redhat.com> - 0.10.2-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Added pam as required package
- An alternative webUI rebased to latest upstream sources
- Improved configuration files permissions in rpm
* Tue Mar 19 2019 Tomas Jelinek <tojeline@redhat.com> - 0.10.1-4 * Tue Mar 19 2019 Tomas Jelinek <tojeline@redhat.com> - 0.10.1-4
- Removed unused dependency rubygem-multi_json - Removed unused dependency rubygem-multi_json
- Removed files needed only for building rubygems from the package - Removed files needed only for building rubygems from the package

View File

@ -1,59 +0,0 @@
From fa7e547053fc5bf7f26081558176fd2fcdee21f6 Mon Sep 17 00:00:00 2001
From: Ondrej Mular <omular@redhat.com>
Date: Sat, 29 Sep 2018 00:16:12 +0200
Subject: [PATCH 3/4] skip tests which require root user
---
pcs/test/test_cluster.py | 4 +++-
pcs/test/tools/misc.py | 6 ++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/pcs/test/test_cluster.py b/pcs/test/test_cluster.py
index deff5160..eab81e00 100644
--- a/pcs/test/test_cluster.py
+++ b/pcs/test/test_cluster.py
@@ -11,6 +11,7 @@ from pcs.test.tools.assertions import (
from pcs.test.tools.misc import (
get_test_resource as rc,
skip_unless_pacemaker_version,
+ skip_unless_root,
)
from pcs.test.tools.pcs_runner import (
pcs,
@@ -140,7 +141,7 @@ class ClusterUpgradeTest(unittest.TestCase, AssertPcsMixin):
assert r == 0
-
+@skip_unless_root()
class ClusterStartStop(unittest.TestCase, AssertPcsMixin):
def setUp(self):
self.pcs_runner = PcsRunner(cib_file=None)
@@ -156,6 +157,7 @@ class ClusterStartStop(unittest.TestCase, AssertPcsMixin):
)
+@skip_unless_root()
class ClusterEnableDisable(unittest.TestCase, AssertPcsMixin):
def setUp(self):
self.pcs_runner = PcsRunner(cib_file=None)
diff --git a/pcs/test/tools/misc.py b/pcs/test/tools/misc.py
index 23fd710a..7bfd3fba 100644
--- a/pcs/test/tools/misc.py
+++ b/pcs/test/tools/misc.py
@@ -154,6 +154,12 @@ def skip_unless_lsb_network_available():
"lsb:network resource agent is not available"
)
+def skip_unless_root():
+ return skipUnless(
+ os.getuid() == 0,
+ "Root user required"
+ )
+
def create_patcher(target_prefix_or_module):
"""
Return function for patching tests with preconfigured target prefix
--
2.18.0

View File

@ -2,4 +2,6 @@ SHA512 (pcsd-bundle-config-1) = f2a2df2dab39c2012cc6a91517716dde8f5a48788d1069c4
SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a
SHA512 (tornado-5.0.2.tar.gz) = 8e6d2757ef4179fc8f23efa63f6b22e5c303a8a1da1efda6a8df4a2acc22f0e67bed2ca504eac82c491c5bd0a087f9dcc76c4b6bd27afdf2fdc8c988f1dc1096 SHA512 (tornado-5.0.2.tar.gz) = 8e6d2757ef4179fc8f23efa63f6b22e5c303a8a1da1efda6a8df4a2acc22f0e67bed2ca504eac82c491c5bd0a087f9dcc76c4b6bd27afdf2fdc8c988f1dc1096
SHA512 (tilt-2.0.8.gem) = 1767f2e5ce45afe95d84d32de7c2b6fe24ff7cb6f7ee8485d84344820b2f6e969ae60a6fbaa7141f7fe135c6540d96fa5b27fd8010b95c0ded5d049a315001d5 SHA512 (tilt-2.0.8.gem) = 1767f2e5ce45afe95d84d32de7c2b6fe24ff7cb6f7ee8485d84344820b2f6e969ae60a6fbaa7141f7fe135c6540d96fa5b27fd8010b95c0ded5d049a315001d5
SHA512 (pcs-0.10.1.tar.gz) = fe028b562453e45602d1d91a6014761f0118ac13ad6a387eaed48535f38a34308c0fed6586929fda514eccabdc632d243644816339e442b217c653890fc05e65 SHA512 (pcs-0.10.2.tar.gz) = 2c644c212981033989dc77ef07f9f6f28dcaa1a28c51abf3861405137339242ad3f7a1e850aace3ab062552ee7a944e19b7593d0667b68ee0353aa7e1945b18b
SHA512 (pcs-web-ui-0.1.1.tar.gz) = 470356be3f934b078c10ac7027db9bc690511249909c3439c86ebbf93926e1047c128b8ec9e10d09f99b67d7657dfbf77f016bf2e6ddb32c97dccc5285dd7d64
SHA512 (pcs-web-ui-node-modules-0.1.1.tar.xz) = 8d8d53ebeca697bce5085c539a27cac5a17a7eaf35ec69b6e1412f95d64a2f3c876e77996e3c1d8c1edb1ebaf7dd3e7638dbe4ce94533738428b34a72acb8d42