From 50c00aa681e4ed40a39be4bbdc8bd7c24531c46d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 07 2019 04:12:20 +0000 Subject: import pcs-0.10.1-4.el8 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21c95da --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +SOURCES/HAM-logo.png +SOURCES/backports-3.11.4.gem +SOURCES/ethon-0.11.0.gem +SOURCES/ffi-1.9.25.gem +SOURCES/json-2.1.0.gem +SOURCES/multi_json-1.13.1.gem +SOURCES/mustermann-1.0.3.gem +SOURCES/open4-1.3.4.gem +SOURCES/pcs-0.10.1.tar.gz +SOURCES/pyagentx-0.4.pcs.2.tar.gz +SOURCES/rack-2.0.6.gem +SOURCES/rack-protection-2.0.4.gem +SOURCES/rack-test-1.0.0.gem +SOURCES/sinatra-2.0.4.gem +SOURCES/tilt-2.0.8.gem +SOURCES/tornado-5.0.2.tar.gz diff --git a/.pcs.metadata b/.pcs.metadata new file mode 100644 index 0000000..dfc1f83 --- /dev/null +++ b/.pcs.metadata @@ -0,0 +1,16 @@ +80dc7788a3468fb7dd362a4b8bedd9efb373de89 SOURCES/HAM-logo.png +edf08f3a0d9e202048857d78ddda44e59294084c SOURCES/backports-3.11.4.gem +3c921ceeb2847be8cfa25704be74923e233786bd SOURCES/ethon-0.11.0.gem +86fa011857f977254ccf39f507587310f9ade768 SOURCES/ffi-1.9.25.gem +8b9e81a2a6ff57f97bec1f65940c61cc6b6d81be SOURCES/json-2.1.0.gem +ff6e0965061cb6f604ee4d87a2cf96a2917f9f88 SOURCES/multi_json-1.13.1.gem +2d090e7d3cd2a35efeaeacf006100fb83b828686 SOURCES/mustermann-1.0.3.gem +41a7fe9f8e3e02da5ae76c821b89c5b376a97746 SOURCES/open4-1.3.4.gem +e933ccad637141fc4814890d82c5d274cee45b32 SOURCES/pcs-0.10.1.tar.gz +3176b2f2b332c2b6bf79fe882e83feecf3d3f011 SOURCES/pyagentx-0.4.pcs.2.tar.gz +b15267e1f94e69238a00a6f1bd48fb7683c03a78 SOURCES/rack-2.0.6.gem +c1376e5678322b401d988d261762a78bf2cf3361 SOURCES/rack-protection-2.0.4.gem +4c99cf0a82372a1bc5968c1551d9e606b68b4879 SOURCES/rack-test-1.0.0.gem +1c85f05c874bc8c0bf9c40291ea2d430090cdfd9 SOURCES/sinatra-2.0.4.gem +ac4b5bc216a961287b3c2ebde877c039d2f1a83d SOURCES/tilt-2.0.8.gem +c8690c8108ce9edd6c55151f66ade61e0a11ab10 SOURCES/tornado-5.0.2.tar.gz diff --git a/SOURCES/bz1656953-01-drop-removed-command-pcs-resource-show-from-help.patch b/SOURCES/bz1656953-01-drop-removed-command-pcs-resource-show-from-help.patch new file mode 100644 index 0000000..47c051e --- /dev/null +++ b/SOURCES/bz1656953-01-drop-removed-command-pcs-resource-show-from-help.patch @@ -0,0 +1,47 @@ +From 5c564d478916abda776215cdec2a0ecf7f1bd782 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Fri, 11 Jan 2019 15:13:09 +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 + diff --git a/SOURCES/bz1659051-01-fix-link-options-names-in-cluster-setup.patch b/SOURCES/bz1659051-01-fix-link-options-names-in-cluster-setup.patch new file mode 100644 index 0000000..cab57f7 --- /dev/null +++ b/SOURCES/bz1659051-01-fix-link-options-names-in-cluster-setup.patch @@ -0,0 +1,108 @@ +From 0a672951ac07341a254dfd52d97348be6a13db33 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Fri, 11 Jan 2019 15:13:09 +0100 +Subject: [PATCH] fix link options' names in cluster setup + +--- + pcs/lib/commands/test/cluster/test_setup.py | 27 +++++++++++++++------ + pcs/lib/corosync/config_facade.py | 15 +++++++++--- + 2 files changed, 32 insertions(+), 10 deletions(-) + +diff --git a/pcs/lib/commands/test/cluster/test_setup.py b/pcs/lib/commands/test/cluster/test_setup.py +index bc7b51f0..441c4d67 100644 +--- a/pcs/lib/commands/test/cluster/test_setup.py ++++ b/pcs/lib/commands/test/cluster/test_setup.py +@@ -95,10 +95,10 @@ def add_key_prefix(prefix, options): + options = options or {} + return {f"{prefix}{key}": value for key, value in options.items()} + +-def options_fixture(options): ++def options_fixture(options, template=OPTION_TEMPLATE): + options = options or {} + return "".join([ +- OPTION_TEMPLATE.format(option=o, value=v) ++ template.format(option=o, value=v) + for o, v in sorted(options.items()) + ]) + +@@ -107,7 +107,7 @@ def corosync_conf_fixture( + links_numbers=None, quorum_options=None, totem_options=None, + transport_options=None, compression_options=None, crypto_options=None, + ): +- # pylint: disable=too-many-arguments ++ # pylint: disable=too-many-arguments, too-many-locals + if transport_type == "knet" and not crypto_options: + crypto_options = { + "cipher": "aes256", +@@ -115,18 +115,31 @@ def corosync_conf_fixture( + } + interface_list = "" + if link_list: ++ knet_options = { ++ "link_priority", ++ "ping_interval", ++ "ping_precision", ++ "ping_timeout", ++ "pong_count", ++ "transport", ++ } ++ + link_list = [dict(link) for link in link_list] + links_numbers = links_numbers if links_numbers else list( + range(constants.LINKS_KNET_MAX) + ) + for i, link in enumerate(link_list): + link["linknumber"] = links_numbers[i] ++ link_translated = {} ++ for name, value in link.items(): ++ if name in knet_options: ++ name = f"knet_{name}" ++ link_translated[name] = value ++ link_list[i] = link_translated ++ + interface_list = "".join([ + INTERFACE_TEMPLATE.format( +- option_list="".join([ +- INTERFACE_OPTION_TEMPLATE.format(option=o, value=v) +- for o, v in sorted(link.items()) +- ]) ++ option_list=options_fixture(link, INTERFACE_OPTION_TEMPLATE) + ) for link in sorted( + link_list, key=lambda item: item["linknumber"] + ) +diff --git a/pcs/lib/corosync/config_facade.py b/pcs/lib/corosync/config_facade.py +index 13cc61b2..db98f435 100644 +--- a/pcs/lib/corosync/config_facade.py ++++ b/pcs/lib/corosync/config_facade.py +@@ -260,6 +260,14 @@ class ConfigFacade: + + dict options -- link options + """ ++ options_translate = { ++ "link_priority": "knet_link_priority", ++ "ping_interval": "knet_ping_interval", ++ "ping_precision": "knet_ping_precision", ++ "ping_timeout": "knet_ping_timeout", ++ "pong_count": "knet_pong_count", ++ "transport": "knet_transport", ++ } + totem_section = self.__ensure_section(self.config, "totem")[-1] + new_link_section = config_parser.Section("interface") + options_to_set = {} +@@ -268,9 +276,10 @@ class ConfigFacade: + # If broadcast == 1, transform it to broadcast == yes. Else do + # not put the option to the config at all. + if value in ("1", 1): +- options_to_set[name] = "yes" +- continue +- options_to_set[name] = value ++ value = "yes" ++ else: ++ continue ++ options_to_set[options_translate.get(name, name)] = value + self.__set_section_options([new_link_section], options_to_set) + totem_section.add_section(new_link_section) + self.__remove_empty_sections(self.config) +-- +2.17.0 + diff --git a/SOURCES/bz1661059-01-re-add-and-deprecate-pcs-resource-show.patch b/SOURCES/bz1661059-01-re-add-and-deprecate-pcs-resource-show.patch new file mode 100644 index 0000000..cdfb840 --- /dev/null +++ b/SOURCES/bz1661059-01-re-add-and-deprecate-pcs-resource-show.patch @@ -0,0 +1,150 @@ +From be56e49edd4e844e20c8b41a05b42728f66e1455 Mon Sep 17 00:00:00 2001 +From: Tomas Jelinek +Date: Fri, 18 Jan 2019 17:18:18 +0100 +Subject: [PATCH] re-add and deprecate 'pcs resource show' + +--- + pcs/cli/common/parse_args.py | 6 +++ + pcs/cli/common/test/test_parse_args.py | 3 ++ + pcs/resource.py | 63 ++++++++++++++++++++++++++ + pcs/stonith.py | 5 ++ + 4 files changed, 77 insertions(+) + +diff --git a/pcs/cli/common/parse_args.py b/pcs/cli/common/parse_args.py +index 9b5a2be6..efce977f 100644 +--- a/pcs/cli/common/parse_args.py ++++ b/pcs/cli/common/parse_args.py +@@ -22,6 +22,9 @@ PCS_LONG_OPTIONS = [ + "hide-inactive", + # pcs resource (un)manage - enable or disable monitor operations + "monitor", ++ # TODO remove ++ # used only in deprecated 'pcs resource|stonith show' ++ "groups", + ] + + def split_list(arg_list, separator): +@@ -319,6 +322,9 @@ class InputModifiers(): + "--enable": "--enable" in options, + "--force": "--force" in options, + "--full": "--full" in options, ++ # TODO remove ++ # used only in deprecated 'pcs resource|stonith show' ++ "--groups": "--groups" in options, + "--hide-inactive": "--hide-inactive" in options, + "--interactive": "--interactive" in options, + "--local": "--local" in options, +diff --git a/pcs/cli/common/test/test_parse_args.py b/pcs/cli/common/test/test_parse_args.py +index 09b98162..56bb2f41 100644 +--- a/pcs/cli/common/test/test_parse_args.py ++++ b/pcs/cli/common/test/test_parse_args.py +@@ -496,6 +496,9 @@ class InputModifiersTest(TestCase): + "--enable", + "--force", + "--full", ++ # TODO remove ++ # used only in deprecated 'pcs resource|stonith show' ++ "--groups", + "--hide-inactive", + "--interactive", + "--local", +diff --git a/pcs/resource.py b/pcs/resource.py +index eaca7126..862553e0 100644 +--- a/pcs/resource.py ++++ b/pcs/resource.py +@@ -111,6 +111,10 @@ def resource_cmd(lib, argv, modifiers): + resource_meta(lib, argv_next, modifiers) + elif sub_cmd in {"delete", "remove"}: + resource_remove_cmd(lib, argv_next, modifiers) ++ # TODO remove, deprecated command ++ # replaced with 'resource status' and 'resource config' ++ elif sub_cmd == "show": ++ resource_show(lib, argv_next, modifiers) + elif sub_cmd == "status": + resource_status(lib, argv_next, modifiers) + elif sub_cmd == "config": +@@ -2225,6 +2229,65 @@ def resource_group_list(lib, argv, modifiers): + line_parts.append(resource.getAttribute("id")) + print(" ".join(line_parts)) + ++def resource_show(lib, argv, modifiers, stonith=False): ++ # TODO remove, deprecated command ++ # replaced with 'resource status' and 'resource config' ++ """ ++ Options: ++ * -f - CIB file ++ * --full - print all configured options ++ * --groups - print resource groups ++ * --hide-inactive - print only active resources ++ """ ++ modifiers.ensure_only_supported( ++ "-f", "--full", "--groups", "--hide-inactive" ++ ) ++ mutually_exclusive_opts = ("--full", "--groups", "--hide-inactive") ++ specified_modifiers = [ ++ opt for opt in mutually_exclusive_opts if modifiers.is_specified(opt) ++ ] ++ if (len(specified_modifiers) > 1) or (argv and specified_modifiers): ++ utils.err( ++ "you can specify only one of resource id, {0}".format( ++ ", ".join(mutually_exclusive_opts) ++ ) ++ ) ++ ++ if modifiers.get("--groups"): ++ warn( ++ "This command is deprecated and will be removed. " ++ "Please use 'pcs resource group list' instead." ++ ) ++ resource_group_list(lib, argv, modifiers.get_subset("-f")) ++ return ++ ++ if modifiers.get("--full") or argv: ++ warn( ++ "This command is deprecated and will be removed. " ++ "Please use 'pcs {} config' instead.".format( ++ "stonith" if stonith else "resource" ++ ) ++ ) ++ resource_config( ++ lib, ++ argv, ++ modifiers.get_subset("-f"), ++ stonith=stonith ++ ) ++ return ++ ++ warn( ++ "This command is deprecated and will be removed. " ++ "Please use 'pcs {} status' instead.".format( ++ "stonith" if stonith else "resource" ++ ) ++ ) ++ resource_status( ++ lib, ++ argv, ++ modifiers.get_subset("-f", "--hide-inactive"), ++ stonith=stonith ++ ) + + def resource_status(lib, argv, modifiers, stonith=False): + """ +diff --git a/pcs/stonith.py b/pcs/stonith.py +index 3f08efe3..c5270c84 100644 +--- a/pcs/stonith.py ++++ b/pcs/stonith.py +@@ -40,6 +40,11 @@ def stonith_cmd(lib, argv, modifiers): + resource.resource_update(lib, argv_next, modifiers) + elif sub_cmd in {"delete", "remove"}: + resource.resource_remove_cmd(lib, argv_next, modifiers) ++ # TODO remove, deprecated command ++ # replaced with 'stonith status' and 'stonith config' ++ elif sub_cmd == "show": ++ resource.resource_show(lib, argv_next, modifiers, stonith=True) ++ print_stonith_levels(lib) + elif sub_cmd == "status": + resource.resource_status(lib, argv_next, modifiers, stonith=True) + print_stonith_levels(lib) +-- +2.17.0 + diff --git a/SOURCES/bz1664057-01-gui-issues-in-create-new-cluster-form.patch b/SOURCES/bz1664057-01-gui-issues-in-create-new-cluster-form.patch new file mode 100644 index 0000000..7b3ff0a --- /dev/null +++ b/SOURCES/bz1664057-01-gui-issues-in-create-new-cluster-form.patch @@ -0,0 +1,248 @@ +From 52b6ec5ac3ffc03d42217f85cda4fdff0f441735 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Fri, 11 Jan 2019 15:13:09 +0100 +Subject: [PATCH] squash bz1664057 [GUI] Issues in 'create new clust + +2dfc71c34bd5 refresh changed node addresses in link details + +17241fa845f6 omit empty node addresses in api call + +90558e69fb9f remove old err messages after successfull setup + +b073db339cf2 omit "addrs" in webui api call on empty addresses +--- + pcsd/public/js/api.js | 10 ++-- + pcsd/public/js/cluster-setup.js | 60 ++++++++++++++++++----- + pcsd/public/js/dev/tests-cluster-setup.js | 25 ++++++++-- + pcsd/views/manage.erb | 2 +- + 4 files changed, 75 insertions(+), 22 deletions(-) + +diff --git a/pcsd/public/js/api.js b/pcsd/public/js/api.js +index c6eb20d6..6c433b54 100644 +--- a/pcsd/public/js/api.js ++++ b/pcsd/public/js/api.js +@@ -212,10 +212,12 @@ api.clusterSetup = function(submitData, processOptions){ + var data = { + cluster_name: setupData.clusterName, + nodes: setupData.nodeList.map(function(node){ +- return { +- name: node.name, +- addrs: node.addrs, +- }; ++ apiNode = { name: node.name }; ++ var addrs = node.addrs.filter(function(addr){return addr.length > 0}); ++ if (addrs.length > 0) { ++ apiNode["addrs"] = addrs; ++ } ++ return apiNode; + }), + transport_type: setupData.transportType, + transport_options: setupData.transportType == "knet" +diff --git a/pcsd/public/js/cluster-setup.js b/pcsd/public/js/cluster-setup.js +index e14b314d..2b7b0a4e 100644 +--- a/pcsd/public/js/cluster-setup.js ++++ b/pcsd/public/js/cluster-setup.js +@@ -50,12 +50,7 @@ clusterSetup.link.detail.create = function(transportType, nodesNames){ + var addrList = detail.find(".transport-addresses"); + + $(nodesNames).each(function(j, nodeName){ +- var address = tools.snippet.take("transport-addr").find("tr"); +- $(".node-name", address).text(nodeName+":"); +- $(".address", address) +- .attr("name", clusterSetup.link.detail.addressName(nodeName)) +- ; +- $(addrList).append(address); ++ $(addrList).append(clusterSetup.link.detail.createAddress(nodeName)); + }); + + detail.find(".options").append( +@@ -67,6 +62,34 @@ clusterSetup.link.detail.create = function(transportType, nodesNames){ + return detail; + }; + ++clusterSetup.link.detail.createAddress = function(nodeName){ ++ var address = tools.snippet.take("transport-addr").find("tr"); ++ address.attr("data-transport-addr-host", nodeName) ++ $(".node-name", address).text(nodeName+":"); ++ $(".address", address) ++ .attr("name", clusterSetup.link.detail.addressName(nodeName)) ++ ; ++ return address; ++}; ++ ++clusterSetup.link.detail.refreshNodesNames = function(linkDetail, nodesNames){ ++ // Is fast enough. No cache required. ++ var previousNodesNames = $.makeArray( ++ linkDetail ++ .find(".transport-addresses [data-transport-addr-host]") ++ .map(function(){return $(this).attr("data-transport-addr-host")}) ++ ); ++ ++ var newAddresses = nodesNames.map(function(nodeName){ ++ return previousNodesNames.contains(nodeName) ++ ? linkDetail.find("[data-transport-addr-host="+nodeName+"]") ++ : clusterSetup.link.detail.createAddress(nodeName) ++ ; ++ }); ++ ++ linkDetail.find(".transport-addresses").empty().append(newAddresses); ++}; ++ + //------------------------------------------------------------------------------ + clusterSetup.netmap.updateAddLinkAbility = function(transportType, linkList){ + var addLinkButton = $("#csetup-transport-netmaps .add-link"); +@@ -108,10 +131,16 @@ clusterSetup.netmap.current.get = function(){ + return $(clusterSetup.netmap.current.selector()); + }; + +-clusterSetup.netmap.current.detailList = function(){ ++clusterSetup.netmap.current.detailsContainer = function(){ + return $(clusterSetup.netmap.current.selector() +" .link-detail-list"); + }; + ++clusterSetup.netmap.current.detailList = function(){ ++ return $( ++ clusterSetup.netmap.current.selector() +" .link-detail-list .detail" ++ ); ++}; ++ + clusterSetup.netmap.current.linksContainer = function(){ + return $(clusterSetup.netmap.current.selector() +" .link-container"); + }; +@@ -143,7 +172,7 @@ clusterSetup.netmap.current.createLink = function(id, nodesNames){ + .attr(clusterSetup.link.pairAttr, id) + ); + +- clusterSetup.netmap.current.detailList().append( ++ clusterSetup.netmap.current.detailsContainer().append( + clusterSetup.link.detail + .create(clusterSetup.transportType.current(), nodesNames) + .attr(clusterSetup.link.pairAttr, id) +@@ -171,8 +200,8 @@ clusterSetup.netmap.current.setCurrentLink = function(id){ + linkList.children().each(function(){ $(this).removeClass("current") }); + linkList.children(pairSelector).addClass("current"); + +- clusterSetup.netmap.current.detailList().find(".detail").hide(); +- clusterSetup.netmap.current.detailList().find(pairSelector).show() ++ clusterSetup.netmap.current.detailList().hide(); ++ clusterSetup.netmap.current.detailsContainer().find(pairSelector).show() + ; + }; + +@@ -320,7 +349,7 @@ clusterSetup.data.settings = function(clusterName, nodesNames){ + { + clusterName: clusterName, + nodeList: clusterSetup.data.nodes(nodesNames, function(nodeName){ +- return clusterSetup.netmap.current.detailList() ++ return clusterSetup.netmap.current.detailsContainer() + .find("[name='"+clusterSetup.link.detail.addressName(nodeName)+"']") + .map(function(){ return $(this).val().trim() }) + .toArray() +@@ -371,7 +400,7 @@ clusterSetup.data.settings = function(clusterName, nodesNames){ + clusterSetup.transportType.current() === "knet" + + ? { +- linkList: clusterSetup.netmap.current.detailList().find(".detail") ++ linkList: clusterSetup.netmap.current.detailList() + .map(function(linknumber, form){ + return $.extend({linknumber: linknumber}, fromForm(form, [ + "ip_version", +@@ -414,7 +443,7 @@ clusterSetup.data.settings = function(clusterName, nodesNames){ + ), + compression: {}, + crypto: {}, +- linkList: clusterSetup.netmap.current.detailList().find(".detail") ++ linkList: clusterSetup.netmap.current.detailList() + .map(function(linknumber, form){ + return fromForm( + form, +@@ -481,6 +510,10 @@ clusterSetup.step.clusterSettings = function(clusterName, nodesNames, actions){ + + $("#csetup .cluster-settings").tabs(); + ++ clusterSetup.netmap.current.detailList().each(function(){ ++ clusterSetup.link.detail.refreshNodesNames($(this), nodesNames); ++ }); ++ + $("#csetup-transport-netmaps .add-link").unbind("click").click(function(){ + clusterSetup.netmap.current.createLink( + clusterSetup.generateUid(), +@@ -688,6 +721,7 @@ clusterSetup.submit.run = function(useAdvancedOptions){ + ); + + }).then(function(){ ++ clusterSetup.dialog.resetMessages([]); + return api.rememberCluster(formData.clusterName, formData.nodesNames); + + }).then(function(){ +diff --git a/pcsd/public/js/dev/tests-cluster-setup.js b/pcsd/public/js/dev/tests-cluster-setup.js +index 54b7fbdd..b3b9f5c8 100644 +--- a/pcsd/public/js/dev/tests-cluster-setup.js ++++ b/pcsd/public/js/dev/tests-cluster-setup.js +@@ -16,15 +16,16 @@ dev.utils.clusterSetupDialog.prefill = function(url, nodesNames){ + clusterSetup.submit.run(true); + + setTimeout(function(){ +- // dev.utils.clusterSetupDialog.prefillKnet(); ++ dev.utils.clusterSetupDialog.prefillKnet(); ++ dev.utils.clusterSetupDialog.prefillTransportOptionsKnet(); + dev.utils.clusterSetupDialog.prefillCompression(); + dev.utils.clusterSetupDialog.prefillCrypto(); + dev.utils.clusterSetupDialog.prefillTotem(); + dev.utils.clusterSetupDialog.prefillQuorum(); +- dev.utils.clusterSetupDialog.prefillTransportOptionsUdp("udp"); +- $("[href='#csetup-transport-options']").trigger("click"); ++ // dev.utils.clusterSetupDialog.prefillTransportOptionsUdp("udp"); ++ // $("[href='#csetup-transport-options']").trigger("click"); + // $("[href='#csetup-quorum']").trigger("click"); +- dev.utils.clusterSetupDialog.prefillUdp("udpu"); ++ // dev.utils.clusterSetupDialog.prefillUdp("udpu"); + $(".ui-dialog:has('#csetup') button:contains('Create cluster')") + // .trigger("click") + ; +@@ -390,6 +391,21 @@ testClusterSetup.clusterSetupUnforcible = function(url, data, success, fail){ + } + }; + ++testClusterSetup.clusterSetupUnforcibleFirstTime = ++function(url, data, success, fail){ ++ switch(url){ ++ case "/manage/cluster-setup": ++ if (dev.flags.cluster_setup_test_setup_first_time_was_run === undefined) { ++ dev.flags.cluster_setup_test_setup_first_time_was_run = true; ++ return success( ++ JSON.stringify(dev.fixture.libErrorUnforcibleLarge) ++ ); ++ } ++ default: ++ return testClusterSetup.successPath(url, data, success, fail); ++ } ++}; ++ + testClusterSetup.clusterSetupException = function(url, data, success, fail){ + switch(url){ + case "/manage/cluster-setup": +@@ -467,6 +483,7 @@ dev.runScenario( + // testClusterSetup.clusterSetup403 + // testClusterSetup.clusterSetup500 + // testClusterSetup.clusterSetupUnforcible ++ // testClusterSetup.clusterSetupUnforcibleFirstTime + // testClusterSetup.clusterSetupException + // testClusterSetup.clusterSetupForceFail + // testClusterSetup.clusterSetupForceFailForcible +diff --git a/pcsd/views/manage.erb b/pcsd/views/manage.erb +index 7b0c9daa..c0569d40 100644 +--- a/pcsd/views/manage.erb ++++ b/pcsd/views/manage.erb +@@ -1075,7 +1075,7 @@ It is very useful when combined with Last Man Standing. + + + +- ++ + +
+ +-- +2.17.0 + diff --git a/SOURCES/bz1668422-01-fix-crashes-when-using-unsupported-options.patch b/SOURCES/bz1668422-01-fix-crashes-when-using-unsupported-options.patch new file mode 100644 index 0000000..a4f8fdb --- /dev/null +++ b/SOURCES/bz1668422-01-fix-crashes-when-using-unsupported-options.patch @@ -0,0 +1,46 @@ +From ff470338e6232d72f3e9f697d5c90c0f7e2a7993 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Wed, 30 Jan 2019 15:13:17 +0100 +Subject: [PATCH] fix crashes when using unsupported options + +--- + pcs/config.py | 9 +++++---- + pcs/status.py | 1 + + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/pcs/config.py b/pcs/config.py +index 304c9040..f0d80222 100644 +--- a/pcs/config.py ++++ b/pcs/config.py +@@ -48,11 +48,12 @@ from pcs.cli.common.errors import CmdLineInputError + # pylint: disable=too-many-branches, too-many-locals, too-many-statements + + def config_cmd(lib, argv, modifiers): +- if not argv: +- config_show(lib, argv, modifiers) +- return +- + try: ++ if not argv: ++ sub_cmd = "show" ++ config_show(lib, argv, modifiers) ++ return ++ + sub_cmd = argv.pop(0) + if sub_cmd == "help": + usage.config(argv) +diff --git a/pcs/status.py b/pcs/status.py +index 5b3af0d1..3ba7d152 100644 +--- a/pcs/status.py ++++ b/pcs/status.py +@@ -23,6 +23,7 @@ from pcs.lib.sbd import get_sbd_service_name + def status_cmd(lib, argv, modifiers): + try: + if not argv: ++ sub_cmd = "status" + full_status(lib, argv, modifiers) + sys.exit(0) + +-- +2.17.0 + diff --git a/SOURCES/do-not-support-cluster-setup-with-udp-u-transport.patch b/SOURCES/do-not-support-cluster-setup-with-udp-u-transport.patch new file mode 100644 index 0000000..0d914c6 --- /dev/null +++ b/SOURCES/do-not-support-cluster-setup-with-udp-u-transport.patch @@ -0,0 +1,53 @@ +From ae936f1a9b148e635963290a1bc645013ee422fe Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Tue, 20 Nov 2018 15:03:56 +0100 +Subject: [PATCH] do not support cluster setup with udp(u) transport + +--- + pcs/pcs.8 | 2 ++ + pcs/usage.py | 1 + + pcsd/public/css/style.css | 3 +++ + 3 files changed, 6 insertions(+) + +diff --git a/pcs/pcs.8 b/pcs/pcs.8 +index aa72aa91..e1cae477 100644 +--- a/pcs/pcs.8 ++++ b/pcs/pcs.8 +@@ -249,6 +249,8 @@ By default, encryption is enabled with cipher=aes256 and hash=sha256. To disable + + Transports udp and udpu: + .br ++WARNING: These transports are not supported in RHEL 8. ++.br + These transports are limited to one address per node. They do not support traffic encryption nor compression. + .br + Transport options are: ip_version, netmtu +diff --git a/pcs/usage.py b/pcs/usage.py +index 4487d844..4c968366 100644 +--- a/pcs/usage.py ++++ b/pcs/usage.py +@@ -631,6 +631,7 @@ Commands: + hash=sha256. To disable encryption, set cipher=none and hash=none. + + Transports udp and udpu: ++ WARNING: These transports are not supported in RHEL 8. + These transports are limited to one address per node. They do not + support traffic encryption nor compression. + Transport options are: +diff --git a/pcsd/public/css/style.css b/pcsd/public/css/style.css +index b857cbae..b8d48d92 100644 +--- a/pcsd/public/css/style.css ++++ b/pcsd/public/css/style.css +@@ -949,6 +949,9 @@ table.args-table td.reg { + width: 6ch; + text-align: right; + } ++#csetup-transport .transport-types { ++ display: none; ++} + #csetup-transport-options.udp .knet-only, + #csetup-transport-options.knet .without-knet + { +-- +2.17.0 + diff --git a/SOURCES/pcsd-bundle-config-1 b/SOURCES/pcsd-bundle-config-1 new file mode 100644 index 0000000..c067a62 --- /dev/null +++ b/SOURCES/pcsd-bundle-config-1 @@ -0,0 +1,5 @@ +--- +BUNDLE_FROZEN: '1' +BUNDLE_PATH: vendor/bundle +BUNDLE_DISABLE_SHARED_GEMS: '1' +BUNDLE_BUILD: --with-ldflags="-Wl,-z,now -Wl,-z,relro" diff --git a/SPECS/pcs.spec b/SPECS/pcs.spec new file mode 100644 index 0000000..62fa301 --- /dev/null +++ b/SPECS/pcs.spec @@ -0,0 +1,755 @@ +Name: pcs +Version: 0.10.1 +Release: 4%{?dist} +# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses +# GPLv2: pcs +# ASL 2.0: tornado +# MIT: handlebars +License: GPLv2 and ASL 2.0 and MIT +URL: https://github.com/ClusterLabs/pcs +Group: System Environment/Base +Summary: Pacemaker Configuration System +#building only for architectures with pacemaker and corosync available +ExclusiveArch: i686 x86_64 s390x ppc64le aarch64 + + +%global pcs_snmp_pkg_name pcs-snmp + +%global pyagentx_version 0.4.pcs.2 +%global tornado_version 5.0.2 +%global version_rubygem_backports 3.11.4 +%global version_rubygem_ethon 0.11.0 +%global version_rubygem_ffi 1.9.25 +%global version_rubygem_json 2.1.0 +%global version_rubygem_multi_json 1.13.1 +%global version_rubygem_mustermann 1.0.3 +%global version_rubygem_open4 1.3.4 +%global version_rubygem_rack 2.0.6 +%global version_rubygem_rack_protection 2.0.4 +%global version_rubygem_rack_test 1.0.0 +%global version_rubygem_sinatra 2.0.4 +%global version_rubygem_tilt 2.0.8 + +# We do not use _libdir macro because upstream is not prepared for it. +# Pcs does not include binaries and thus it should live in /usr/lib. Tornado +# and gems include binaries and thus it should live in /usr/lib64. But the +# path to tornado/gems is hardcoded in pcs sources. Modify hard links in pcs +# sources is not the way since then rpmdiff complains that the same file has +# different content in different architectures. +%global pcs_libdir %{_prefix}/lib +%global bundled_src_dir pcs/bundled +%global rubygem_cache_dir pcsd/vendor/cache +%global rubygem_bundle_dir pcsd/vendor/bundle/ruby + +# mangling shebang in /usr/lib/pcsd/vendor/bundle/ruby/gems/rack-2.0.5/test/cgi/test from /usr/bin/env ruby to #!/usr/bin/ruby +#*** ERROR: ./usr/lib/pcsd/vendor/bundle/ruby/gems/rack-2.0.5/test/cgi/test.ru has shebang which doesn't start with '/' (../../bin/rackup) +#mangling shebang in /usr/lib/pcsd/vendor/bundle/ruby/gems/rack-2.0.5/test/cgi/rackup_stub.rb from /usr/bin/env ruby to #!/usr/bin/ruby +#*** WARNING: ./usr/lib/pcsd/vendor/bundle/ruby/gems/rack-2.0.5/test/cgi/sample_rackup.ru is executable but has empty or no shebang, removing executable bit +#*** WARNING: ./usr/lib/pcsd/vendor/bundle/ruby/gems/rack-2.0.5/test/cgi/lighttpd.conf is executable but has empty or no shebang, removing executable bit +#*** ERROR: ambiguous python shebang in /usr/lib/pcsd/vendor/bundle/ruby/gems/ffi-1.9.25/ext/ffi_c/libffi/generate-darwin-source-and-headers.py: #!/usr/bin/env python. Change it to python3 (or python2) explicitly. +%undefine __brp_mangle_shebangs + +# https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Python_bytecompilation +# Enforce python3 because bytecompilation of tornado produced warnings: +# DEPRECATION WARNING: python2 invoked with /usr/bin/python. +# Use /usr/bin/python3 or /usr/bin/python2 +# /usr/bin/python will be removed or switched to Python 3 in the future. +%global __python %{__python3} + +#part after last slash is recognized as filename in look-aside repository +#desired name is achived by trick with hash anchor +Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: HAM-logo.png +Source2: pcsd-bundle-config-1 + +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 + +Source81: https://rubygems.org/downloads/backports-%{version_rubygem_backports}.gem +Source82: https://rubygems.org/downloads/ethon-%{version_rubygem_ethon}.gem +Source83: https://rubygems.org/downloads/ffi-%{version_rubygem_ffi}.gem +Source84: https://rubygems.org/downloads/json-%{version_rubygem_json}.gem +Source85: https://rubygems.org/downloads/multi_json-%{version_rubygem_multi_json}.gem +Source86: https://rubygems.org/downloads/mustermann-%{version_rubygem_mustermann}.gem +Source87: https://rubygems.org/downloads/open4-%{version_rubygem_open4}.gem +Source88: https://rubygems.org/downloads/rack-%{version_rubygem_rack}.gem +Source89: https://rubygems.org/downloads/rack-protection-%{version_rubygem_rack_protection}.gem +Source90: https://rubygems.org/downloads/rack-test-%{version_rubygem_rack_test}.gem +Source91: https://rubygems.org/downloads/sinatra-%{version_rubygem_sinatra}.gem +Source92: https://rubygems.org/downloads/tilt-%{version_rubygem_tilt}.gem + +# patches cherry-picked from upstream +Patch1: bz1656953-01-drop-removed-command-pcs-resource-show-from-help.patch +Patch2: bz1659051-01-fix-link-options-names-in-cluster-setup.patch +Patch3: bz1664057-01-gui-issues-in-create-new-cluster-form.patch +Patch4: bz1661059-01-re-add-and-deprecate-pcs-resource-show.patch +# downstream patches +Patch100: bz1668422-01-fix-crashes-when-using-unsupported-options.patch +Patch101: do-not-support-cluster-setup-with-udp-u-transport.patch + +# git for patches +BuildRequires: git +#printf from coreutils is used in makefile +BuildRequires: coreutils +BuildRequires: execstack +# python for pcs +BuildRequires: platform-python +BuildRequires: python3-devel +BuildRequires: platform-python-setuptools +BuildRequires: python3-pycurl +# gcc for compiling custom rubygems +BuildRequires: gcc +BuildRequires: gcc-c++ +# ruby and gems for pcsd +BuildRequires: ruby >= 2.2.0 +BuildRequires: ruby-devel +BuildRequires: rubygems +# ruby libraries for tests +BuildRequires: rubygem-test-unit +# for touching patch files (sanitization function) +BuildRequires: diffstat +# for post, preun and postun macros +BuildRequires: systemd +# for tests +BuildRequires: python3-lxml +BuildRequires: python3-pyOpenSSL +BuildRequires: pacemaker-cli >= 2.0.0 +# BuildRequires: fence-agents-all +BuildRequires: fence-agents-apc +BuildRequires: fence-agents-scsi +BuildRequires: fence-agents-ipmilan +BuildRequires: booth-site +# pcsd fonts and font management tools for creating symlinks to fonts +BuildRequires: fontconfig +BuildRequires: liberation-sans-fonts +BuildRequires: overpass-fonts + +# python and libraries for pcs, setuptools for pcs entrypoint +Requires: platform-python +Requires: python3-lxml +Requires: platform-python-setuptools +Requires: python3-clufter => 0.70.0 +Requires: python3-pycurl +# ruby and gems for pcsd +Requires: ruby >= 2.2.0 +Requires: rubygems +# for killall +Requires: psmisc +# for working with certificates (validation etc.) +Requires: openssl +Requires: python3-pyOpenSSL +# cluster stack and related packages +Requires: pcmk-cluster-manager >= 2.0.0 +Suggests: pacemaker +Requires: (corosync >= 2.99 if pacemaker) +# pcs enables corosync encryption by default so we require libknet1-plugins-all +Requires: (libknet1-plugins-all if corosync) +Requires: pacemaker-cli >= 2.0.0 +# for post, preun and postun macros +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +# pcsd fonts +Requires: liberation-sans-fonts +Requires: overpass-fonts + +Provides: bundled(tornado) = %{tornado_version} +Provides: bundled(backports) = %{version_rubygem_backports} +Provides: bundled(ethon) = %{version_rubygem_ethon} +Provides: bundled(ffi) = %{version_rubygem_ffi} +Provides: bundled(json) = %{version_rubygem_json} +Provides: bundled(multi_json) = %{version_rubygem_multi_json} +Provides: bundled(mustermann) = %{version_rubygem_mustermann} +Provides: bundled(open4) = %{version_rubygem_open4} +Provides: bundled(rack) = %{version_rubygem_rack} +Provides: bundled(rack) = %{version_rubygem_rack_protection} +Provides: bundled(rack) = %{version_rubygem_rack_test} +Provides: bundled(sinatra) = %{version_rubygem_sinatra} +Provides: bundled(tilt) = %{version_rubygem_tilt} + +%description +pcs is a corosync and pacemaker configuration tool. It permits users to +easily view, modify and create pacemaker based clusters. + +# pcs-snmp package definition +%package -n %{pcs_snmp_pkg_name} +Group: System Environment/Base +Summary: Pacemaker cluster SNMP agent +# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses +# GPLv2: pcs +# BSD-2-Clause: pyagentx +License: GPLv2 and BSD-2-Clause +URL: https://github.com/ClusterLabs/pcs + +# tar for unpacking pyagetx source tar ball +BuildRequires: tar + +Requires: pcs = %{version}-%{release} +Requires: pacemaker +Requires: net-snmp + +Provides: bundled(pyagentx) = %{pyagentx_version} + +%description -n %{pcs_snmp_pkg_name} +SNMP agent that provides information about pacemaker cluster to the master agent (snmpd) + +%prep +%autosetup -p1 -S git + +# -- following is inspired by python-simplejon.el5 -- +# Update timestamps on the files touched by a patch, to avoid non-equal +# .pyc/.pyo files across the multilib peers within a build + +update_times(){ + # update_times ... + # set the access and modification times of each file_to_touch to the times + # of reference_file + + # put all args to file_list + file_list=("$@") + # first argument is reference_file: so take it and remove from file_list + reference_file=${file_list[0]} + unset file_list[0] + + for fname in ${file_list[@]}; do + touch -r $reference_file $fname + done +} + +update_times_patch(){ + # update_times_patch + # set the access and modification times of each file in patch to the times + # of patch_file_name + + patch_file_name=$1 + + # diffstat + # -l lists only the filenames. No histogram is generated. + # -p override the logic that strips common pathnames, + # simulating the patch "-p" option. (Strip the smallest prefix containing + # num leading slashes from each file name found in the patch file) + update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}` +} + +update_times_patch %{PATCH1} +update_times_patch %{PATCH2} +update_times_patch %{PATCH3} +update_times_patch %{PATCH4} +update_times_patch %{PATCH5} + +cp -f %SOURCE1 pcsd/public/images + +# prepare dirs/files necessary for building all bundles +# ----------------------------------------------------- +# 1) configuration for rubygems +mkdir -p pcsd/.bundle +cp -f %SOURCE2 pcsd/.bundle/config + +# 2) rubygems sources +mkdir -p pcsd/vendor/cache +cp -f %SOURCE81 pcsd/vendor/cache +cp -f %SOURCE82 pcsd/vendor/cache +cp -f %SOURCE83 pcsd/vendor/cache +cp -f %SOURCE84 pcsd/vendor/cache +cp -f %SOURCE85 pcsd/vendor/cache +cp -f %SOURCE86 pcsd/vendor/cache +cp -f %SOURCE87 pcsd/vendor/cache +cp -f %SOURCE88 pcsd/vendor/cache +cp -f %SOURCE89 pcsd/vendor/cache +cp -f %SOURCE90 pcsd/vendor/cache +cp -f %SOURCE91 pcsd/vendor/cache +cp -f %SOURCE92 pcsd/vendor/cache + + +# 3) dir for python bundles +mkdir -p %{bundled_src_dir} + +# 4) sources for pyagentx +tar -xzf %SOURCE41 -C %{bundled_src_dir} +mv %{bundled_src_dir}/pyagentx-%{pyagentx_version} %{bundled_src_dir}/pyagentx +update_times %SOURCE41 `find %{bundled_src_dir}/pyagentx -follow` +cp %{bundled_src_dir}/pyagentx/LICENSE.txt pyagentx_LICENSE.txt +cp %{bundled_src_dir}/pyagentx/CONTRIBUTORS.txt pyagentx_CONTRIBUTORS.txt +cp %{bundled_src_dir}/pyagentx/README.md pyagentx_README.md + +# 5) sources for tornado +tar -xzf %SOURCE42 -C %{bundled_src_dir} +mv %{bundled_src_dir}/tornado-%{tornado_version} %{bundled_src_dir}/tornado +update_times %SOURCE42 `find %{bundled_src_dir}/tornado -follow` +cp %{bundled_src_dir}/tornado/LICENSE tornado_LICENSE +cp %{bundled_src_dir}/tornado/README.rst tornado_README.rst + +%build +%define debug_package %{nil} + +%install +rm -rf $RPM_BUILD_ROOT +pwd + +# build bundled rubygems (in main install it is disabled by BUILD_GEMS=false) +mkdir -p %{rubygem_bundle_dir} +gem install \ + --force --verbose --no-rdoc --no-ri -l --no-user-install \ + -i %{rubygem_bundle_dir} \ + %{rubygem_cache_dir}/backports-%{version_rubygem_backports}.gem \ + %{rubygem_cache_dir}/ethon-%{version_rubygem_ethon}.gem \ + %{rubygem_cache_dir}/ffi-%{version_rubygem_ffi}.gem \ + %{rubygem_cache_dir}/json-%{version_rubygem_json}.gem \ + %{rubygem_cache_dir}/multi_json-%{version_rubygem_multi_json}.gem \ + %{rubygem_cache_dir}/mustermann-%{version_rubygem_mustermann}.gem \ + %{rubygem_cache_dir}/open4-%{version_rubygem_open4}.gem \ + %{rubygem_cache_dir}/rack-%{version_rubygem_rack}.gem \ + %{rubygem_cache_dir}/rack-protection-%{version_rubygem_rack_protection}.gem \ + %{rubygem_cache_dir}/rack-test-%{version_rubygem_rack_test}.gem \ + %{rubygem_cache_dir}/sinatra-%{version_rubygem_sinatra}.gem \ + %{rubygem_cache_dir}/tilt-%{version_rubygem_tilt}.gem \ + -- '--with-ldflags="-Wl,-z,relro -Wl,-z,ibt -Wl,-z,now -Wl,--gc-sections"' \ + '--with-cflags="-O2 -ffunction-sections"' + +# We can remove files required for gem compilation +rm -rf %{rubygem_bundle_dir}/gems/ffi-%{version_rubygem_ffi}/ext +rm -rf %{rubygem_bundle_dir}/gems/json-%{version_rubygem_json}/ext + + +# With this file there is "File is not stripped" problem during rpmdiff +# See https://docs.engineering.redhat.com/display/HTD/rpmdiff-elf-stripping +for fname in `find %{rubygem_bundle_dir}/extensions -type f -name "*.so"`; do + strip ${fname} +done + + +# main pcs install +make install \ + DESTDIR=$RPM_BUILD_ROOT \ + PREFIX=%{_prefix} \ + SYSTEMD_UNIT_DIR=%{_unitdir} \ + LIB_DIR=%{pcs_libdir} \ + PYTHON=%{__python3} \ + PYTHON_SITELIB=%{python3_sitelib} \ + BASH_COMPLETION_DIR=%{_datadir}/bash-completion/completions \ + BUNDLE_PYAGENTX_SRC_DIR=`readlink -f %{bundled_src_dir}/pyagentx` \ + BUNDLE_TORNADO_SRC_DIR=`readlink -f %{bundled_src_dir}/tornado` \ + BUILD_GEMS=false \ + SYSTEMCTL_OVERRIDE=true \ + hdrdir="%{_includedir}" \ + rubyhdrdir="%{_includedir}" \ + includedir="%{_includedir}" + +# With this file there is "File is not stripped" problem during rpmdiff +# See https://docs.engineering.redhat.com/display/HTD/rpmdiff-elf-stripping +for fname in `find ${RPM_BUILD_ROOT}%{pcs_libdir}/pcs/bundled/packages/tornado/ -type f -name "*.so"`; do + strip ${fname} +done + +#after the ruby gem compilation we do not need ruby gems in the cache +rm -r -v $RPM_BUILD_ROOT%{pcs_libdir}/%{rubygem_cache_dir} + +%check +# In the building environment LC_CTYPE is set to C which causes tests to fail +# due to python prints a warning about it to stderr. The following environment +# variable disables the warning. +# On the live system either UTF8 locale is set or the warning is emmited +# which breaks pcs. That is the correct behavior since with wrong locales it +# would be probably broken anyway. +# The main concern here is to make the tests pass. +# See https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale for details. +export PYTHONCOERCECLOCALE=0 + +run_all_tests(){ + #run pcs tests + + # disabled tests: + # + # pcs.lib.commands.test.test_resource_agent.DescribeAgentUtf8.test_describe + # For a unknwon reason this test is passing outside the mock environment. + # TODO: Investigate the issue + + BUNDLED_LIB_LOCATION=$RPM_BUILD_ROOT%{pcs_libdir}/pcs/bundled/packages \ + %{__python3} pcs/test/suite.py -v --vanilla --all-but \ + pcs.lib.commands.test.test_resource_agent.DescribeAgentUtf8.test_describe \ + + test_result_python=$? + + #run pcsd tests and remove them + pcsd_dir=$RPM_BUILD_ROOT%{pcs_libdir}/pcsd + GEM_HOME=$RPM_BUILD_ROOT%{pcs_libdir}/%{rubygem_bundle_dir} ruby \ + -I${pcsd_dir} \ + -I${pcsd_dir}/test \ + ${pcsd_dir}/test/test_all_suite.rb + 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 + return $test_result_python + fi + return $test_result_ruby +} + +run_all_tests + +%post +%systemd_post pcsd.service + +%post -n %{pcs_snmp_pkg_name} +%systemd_post pcs_snmp_agent.service + +%preun +%systemd_preun pcsd.service + +%preun -n %{pcs_snmp_pkg_name} +%systemd_preun pcs_snmp_agent.service + +%postun +%systemd_postun_with_restart pcsd.service + +%postun -n %{pcs_snmp_pkg_name} +%systemd_postun_with_restart pcs_snmp_agent.service + +%files +%doc CHANGELOG.md +%doc README.md +%doc tornado_README.rst +%license tornado_LICENSE +%license COPYING +%{python3_sitelib}/pcs +%{python3_sitelib}/pcs-0.10.1-py3.*.egg-info +%{_sbindir}/pcs +%{_sbindir}/pcsd +%{pcs_libdir}/pcs/pcs_internal +%{pcs_libdir}/pcsd/* +%{pcs_libdir}/pcsd/.bundle/config +%{pcs_libdir}/pcs/bundled/packages/tornado* +%{_unitdir}/pcsd.service +%{_datadir}/bash-completion/completions/pcs +%{_sharedstatedir}/pcsd +%{_sysconfdir}/pam.d/pcsd +%dir %{_var}/log/pcsd +%config(noreplace) %{_sysconfdir}/logrotate.d/pcsd +%config(noreplace) %{_sysconfdir}/sysconfig/pcsd +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/cfgsync_ctl +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/known-hosts +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcsd.cookiesecret +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcsd.crt +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcsd.key +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcs_settings.conf +%ghost %config(noreplace) %{_sharedstatedir}/pcsd/pcs_users.conf +%{_mandir}/man8/pcs.* +%{_mandir}/man8/pcsd.* +%exclude %{pcs_libdir}/pcsd/*.debian +%exclude %{pcs_libdir}/pcsd/pcsd.service +%exclude %{pcs_libdir}/pcsd/pcsd.conf +%exclude %{pcs_libdir}/pcsd/pcsd.8 +%exclude %{pcs_libdir}/pcsd/public/js/dev/* +%exclude %{python3_sitelib}/pcs/bash_completion +%exclude %{python3_sitelib}/pcs/pcs.8 +%exclude %{python3_sitelib}/pcs/pcs + +%files -n %{pcs_snmp_pkg_name} +%{pcs_libdir}/pcs/pcs_snmp_agent +%{pcs_libdir}/pcs/bundled/packages/pyagentx* +%{_unitdir}/pcs_snmp_agent.service +%{_datadir}/snmp/mibs/PCMK-PCS*-MIB.txt +%{_mandir}/man8/pcs_snmp_agent.* +%config(noreplace) %{_sysconfdir}/sysconfig/pcs_snmp_agent +%doc CHANGELOG.md +%doc pyagentx_CONTRIBUTORS.txt +%doc pyagentx_README.md +%license COPYING +%license pyagentx_LICENSE.txt + +%changelog +* Wed Jan 30 2019 Ivan Devat - 0.10.1-4 +- Fixed crash when using unsupported options in commands `pcs status` and `pcs config` +- Resolves: rhbz#1668422 + +* Mon Jan 14 2019 Ivan Devat - 0.10.1-3 +- Fixed configuration names of link options that pcs puts to corosync.conf during cluster setup +- Fixed webUI issues in cluster setup +- Command `pcs resource show` was returned back and was signed as deprecated +- Added dependency on libknet1-plugins-all +- Resolves: rhbz#1661059 rhbz#1659051 rhbz#1664057 + +* Thu Dec 13 2018 Ondrej Mular - 0.10.1-2 +- Fix documentation +- Resolves: rhbz#1656953 + +* Fri Nov 23 2018 Ivan Devát - 0.10.1-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Udp/udpu transport is marked as unsupported +- Require pcmk-cluster-manager instead of pacemaker +- Require platform-python-setuptools instead of python3-setuptools +- Resolves: rhbz#1650109 rhbz#1183103 rhbz#1648942 rhbz#1650510 rhbz#1388398 rhbz#1651197 rhbz#1553736 + +* Fri Oct 26 2018 Ondrej Mular - 0.10.0.alpha.7-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Resolves: rhbz#1553736 rhbz#1615891 rhbz#1436217 rhbz#1596050 rhbz#1554310 rhbz#1553718 rhbz#1638852 rhbz#1620190 rhbz#1158816 rhbz#1640477 + +* Wed Oct 17 2018 Ondrej Mular - 0.10.0.alpha.6-3 +- Add dependency on rubygems package +- Resolves: rhbz#1553736 + +* Thu Oct 04 2018 Ondrej Mular - 0.10.0.alpha.6-2 +- Enable tests +- Cleanup of unnecessary bundle ruby-gem files +- Switch Require: python3 dependency to platform-python +- Added required linker flags +- Resolves: rhbz#1633613 rhbz#1630616 + +* Wed Sep 19 2018 Ivan Devát - 0.10.0.alpha.6-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Resolves: rhbz#1553736 + +* Thu Sep 13 2018 Ivan Devát - 0.10.0.alpha.5-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Resolves: rhbz#1553736 rhbz#1542288 rhbz#1619620 + +* Thu Sep 13 2018 Ivan Devát - 0.10.0.alpha.4-2 +- Fixed symlinks correction for rubygem ffi +- Resolves: rhbz#1553736 + +* Wed Sep 12 2018 Ivan Devát - 0.10.0.alpha.4-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Resolves: rhbz#1549535 rhbz#1578955 rhbz#1158816 rhbz#1183103 rhbz#1536121 rhbz#1573344 rhbz#1619620 rhbz#1533866 rhbz#1578898 rhbz#1595829 rhbz#1605185 rhbz#1615420 rhbz#1566430 rhbz#1578891 rhbz#1591308 rhbz#1554953 + +* Mon Aug 06 2018 Ivan Devát - 0.10.0.alpha.3-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Removed ruby dependencies (the dependencies are bundled instead) +- Resolves: rhbz#1611990 + +* Thu Aug 02 2018 Ivan Devát - 0.10.0.alpha.2-1 +- Rebased to latest upstream sources (see CHANGELOG.md) + +* Wed Jul 18 2018 Ivan Devát - 0.10.0.alpha.1-1 +- Rebased to latest upstream sources (see CHANGELOG.md) + +* Mon Apr 09 2018 Ondrej Mular - 0.9.164-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Fixed: CVE-2018-1086, CVE-2018-1079 + +* Mon Feb 26 2018 Ivan Devát - 0.9.163-2 +- Fixed crash when adding a node to a cluster + +* Tue Feb 20 2018 Ivan Devát - 0.9.163-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- Adapted for Rack 2 and Sinatra 2 + +* Fri Feb 09 2018 Igor Gnatenko - 0.9.160-5 +- Escape macros in %%changelog + +* Thu Feb 08 2018 Fedora Release Engineering - 0.9.160-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Sat Jan 20 2018 Björn Esser - 0.9.160-3 +- Rebuilt for switch to libxcrypt + +* Fri Jan 05 2018 Mamoru TASAKA - 0.9.160-2 +- F-28: rebuild for ruby25 +- Workaround for gem install option + +* Wed Oct 18 2017 Ondrej Mular - 0.9.160-1 +- Rebased to latest upstream sources (see CHANGELOG.md) +- All pcs tests are temporarily disabled because of issues in pacemaker. + +* Thu Sep 14 2017 Ondrej Mular - 0.9.159-4 +- Bundle rubygem-rack-protection which is being updated to 2.0.0 in Fedora. +- Removed setuptools patch. +- Disabled debuginfo subpackage. + +* Thu Aug 03 2017 Fedora Release Engineering - 0.9.159-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 0.9.159-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jul 12 2017 Ondrej Mular - 0.9.159-1 +- Rebased to latest upstream sources (see CHANGELOG.md) + +* Tue May 23 2017 Tomas Jelinek - 0.9.156-3 +- Fixed python locales issue preventing build-time tests to pass +- Bundle rubygem-tilt which is being retired from Fedora + +* Thu Mar 23 2017 Tomas Jelinek - 0.9.156-2 +- Fixed Cross-site scripting (XSS) vulnerability in web UI CVE-2017-2661 +- Re-added support for clufter as it is now available for Python 3 + +* Wed Feb 22 2017 Tomas Jelinek - 0.9.156-1 +- Rebased to latest upstream sources (see CHANGELOG.md) + +* Sat Feb 11 2017 Fedora Release Engineering - 0.9.155-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Jan 12 2017 Vít Ondruch - 0.9.155-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.4 + +* Wed Jan 04 2017 Adam Williamson - 0.9.155-1 +- Latest release 0.9.155 +- Fix tests with Python 3.6 and lxml 3.7 +- Package the license as license, not doc +- Use -f param for rm when wiping test directories as they are nested now + +* Mon Dec 19 2016 Miro Hrončok +- Rebuild for Python 3.6 + +* Tue Oct 18 2016 Tomas Jelinek - 0.9.154-2 +- Fixed upgrading from pcs-0.9.150 + +* Thu Sep 22 2016 Tomas Jelinek - 0.9.154-1 +- Re-synced to upstream sources +- Spec file cleanup and fixes + +* Tue Jul 19 2016 Fedora Release Engineering - 0.9.150-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Mon Apr 11 2016 Tomas Jelinek - 0.9.150-1 +- Re-synced to upstream sources +- Make pcs depend on python3 +- Spec file cleanup + +* Tue Feb 23 2016 Tomas Jelinek - 0.9.149-2 +- Fixed rubygems issues which prevented pcsd from starting +- Added missing python-lxml dependency + +* Thu Feb 18 2016 Tomas Jelinek - 0.9.149-1 +- Re-synced to upstream sources +- Security fix for CVE-2016-0720, CVE-2016-0721 +- Fixed rubygems issues which prevented pcsd from starting +- Rubygems built with RELRO +- Spec file cleanup +- Fixed multilib .pyc/.pyo issue + +* Thu Feb 04 2016 Fedora Release Engineering - 0.9.144-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 12 2016 Vít Ondruch - 0.9.144-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3 + +* Fri Sep 18 2015 Tomas Jelinek - 0.9.144-1 +- Re-synced to upstream sources + +* Tue Jun 23 2015 Tomas Jelinek - 0.9.141-2 +- Added requirement for psmisc for killall + +* Tue Jun 23 2015 Tomas Jelinek - 0.9.141-1 +- Re-synced to upstream sources + +* Thu Jun 18 2015 Fedora Release Engineering - 0.9.140-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Jun 05 2015 Tomas Jelinek - 0.9.140-1 +- Re-synced to upstream sources + +* Fri May 22 2015 Tomas Jelinek - 0.9.139-4 +- Fix for CVE-2015-1848, CVE-2015-3983 (sessions not signed) + +* Thu Mar 26 2015 Tomas Jelinek - 0.9.139-3 +- Add BuildRequires: systemd (rhbz#1206253) + +* Fri Feb 27 2015 Tomas Jelinek - 0.9.139-2 +- Reflect clufter inclusion (rhbz#1180723) + +* Thu Feb 19 2015 Tomas Jelinek - 0.9.139-1 +- Re-synced to upstream sources + +* Sat Jan 17 2015 Mamoru TASAKA - 0.9.115-5 +- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_2.2 + +* Sun Aug 17 2014 Fedora Release Engineering - 0.9.115-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jun 06 2014 Fedora Release Engineering - 0.9.115-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 06 2014 Tomas Jelinek - 0.9.115-2 +- Rebuild to fix ruby dependencies + +* Mon Apr 21 2014 Chris Feist - 0.9.115-1 +- Re-synced to upstream sources + +* Fri Dec 13 2013 Chris Feist - 0.9.102-1 +- Re-synced to upstream sources + +* Wed Jun 19 2013 Chris Feist - 0.9.48-1 +- Rebuild with upstream sources + +* Thu Jun 13 2013 Chris Feist - 0.9.44-5 +- Added fixes for building rpam with ruby-2.0.0 + +* Mon Jun 03 2013 Chris Feist - 0.9.44-4 +- Rebuild with upstream sources + +* Tue May 07 2013 Chris Feist - 0.9.41-2 +- Resynced to upstream sources + +* Fri Apr 19 2013 Chris Feist - 0.9.39-1 +- Fixed gem building +- Re-synced to upstream sources + +* Mon Mar 25 2013 Chris Feist - 0.9.36-4 +- Don't try to build gems at all + +* Mon Mar 25 2013 Chris Feist - 0.9.36-3 +- Removed all gems from build, will need to find pam package in the future + +* Mon Mar 25 2013 Chris Feist - 0.9.36-2 +- Removed duplicate libraries already present in fedora + +* Mon Mar 18 2013 Chris Feist - 0.9.36-1 +- Resynced to latest upstream + +* Mon Mar 11 2013 Chris Feist - 0.9.33-1 +- Resynched to latest upstream +- pcsd has been moved to /usr/lib to fix /usr/local packaging issues + +* Thu Feb 21 2013 Chris Feist - 0.9.32-1 +- Resynced to latest version of pcs/pcsd + +* Mon Nov 05 2012 Chris Feist - 0.9.27-3 +- Build on all archs + +* Thu Oct 25 2012 Chris Feist - 0.9.27-2 +- Resync to latest version of pcs +- Added pcsd daemon + +* Mon Oct 08 2012 Chris Feist - 0.9.26-1 +- Resync to latest version of pcs + +* Thu Sep 20 2012 Chris Feist - 0.9.24-1 +- Resync to latest version of pcs + +* Thu Sep 20 2012 Chris Feist - 0.9.23-1 +- Resync to latest version of pcs + +* Wed Sep 12 2012 Chris Feist - 0.9.22-1 +- Resync to latest version of pcs + +* Thu Sep 06 2012 Chris Feist - 0.9.19-1 +- Resync to latest version of pcs + +* Tue Aug 07 2012 Chris Feist - 0.9.12-1 +- Resync to latest version of pcs + +* Fri Jul 20 2012 Fedora Release Engineering - 0.9.3.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu May 24 2012 Chris Feist - 0.9.4-1 +- Resync to latest version of pcs +- Move cluster creation options to cluster sub command. + +* Mon May 07 2012 Chris Feist - 0.9.3.1-1 +- Resync to latest version of pcs which includes fixes to work with F17. + +* Mon Mar 19 2012 Chris Feist - 0.9.2.4-1 +- Resynced to latest version of pcs + +* Mon Jan 23 2012 Chris Feist - 0.9.1-1 +- Updated BuildRequires and %%doc section for fedora + +* Fri Jan 20 2012 Chris Feist - 0.9.0-2 +- Updated spec file for fedora specific changes + +* Mon Jan 16 2012 Chris Feist - 0.9.0-1 +- Initial Build