Hello community,

here is the log from the commit of package crmsh for openSUSE:Factory checked 
in at 2017-04-25 08:59:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/crmsh (Old)
 and      /work/SRC/openSUSE:Factory/.crmsh.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "crmsh"

Tue Apr 25 08:59:05 2017 rev:119 rq:490289 version:3.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes      2017-04-24 
09:49:15.651908733 +0200
+++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2017-04-25 
08:59:05.963359332 +0200
@@ -1,0 +2,7 @@
+Mon Apr 24 12:17:13 UTC 2017 - kgronl...@suse.com
+
+- low: bootstrap: Update fix for formatting SBD device (bsc#1028704)
+- medium: bootstrap: Set expected votes based on actual node count 
(bsc#1033288)
+- Add 0007-medium-bootstrap-Set-expected_votes-based-on-actual-.patch 
+
+-------------------------------------------------------------------

New:
----
  0007-medium-bootstrap-Set-expected_votes-based-on-actual-.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ crmsh.spec ++++++
--- /var/tmp/diff_new_pack.0aHcUq/_old  2017-04-25 08:59:06.759246796 +0200
+++ /var/tmp/diff_new_pack.0aHcUq/_new  2017-04-25 08:59:06.763246230 +0200
@@ -54,6 +54,9 @@
 Patch5:         0005-medium-scripts-health-Make-health-script-available-a.patch
 # PATCH-FIX-UPSTREAM: low: remove bindnetaddr for unicast(bsc#1030437)
 Patch6:         0006-remove-bindnetaddr-for-unicast-bsc-1030437.patch
+# PATCH-FIX-UPSTREAM: medium: bootstrap: Set expected votes based on actual 
node count (bsc#1033288)
+Patch7:         0007-medium-bootstrap-Set-expected_votes-based-on-actual-.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if 0%{?suse_version}
 # Requiring pacemaker makes crmsh harder to build on other distributions,
@@ -161,6 +164,7 @@
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 # Force the local time
 #

++++++ 0002-low-bootstrap-Fix-warning-for-formatting-SBD-device-.patch ++++++
--- /var/tmp/diff_new_pack.0aHcUq/_old  2017-04-25 08:59:06.795241706 +0200
+++ /var/tmp/diff_new_pack.0aHcUq/_new  2017-04-25 08:59:06.795241706 +0200
@@ -1,26 +1,28 @@
-From 6bbb4fba305d8eeb921b63f579d9703c633ed7ca Mon Sep 17 00:00:00 2001
+From 4c892429494031ed45f8cc36df714f58cc2cdd43 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <k...@koru.se>
 Date: Thu, 9 Mar 2017 20:27:19 +0100
-Subject: [PATCH 2/4] low: bootstrap: Fix warning for formatting SBD device
+Subject: [PATCH] low: bootstrap: Fix warning for formatting SBD device
  (bsc#1028704)
 
 ---
- crmsh/bootstrap.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ crmsh/bootstrap.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py
-index 2b2e167a..26d5f124 100644
+index 2b2e167a..2fec7dbf 100644
 --- a/crmsh/bootstrap.py
 +++ b/crmsh/bootstrap.py
-@@ -940,7 +940,7 @@ Configure SBD:
+@@ -940,8 +940,8 @@ Configure SBD:
              if not is_block_device(dev):
                  print >>sys.stderr, "    That doesn't look like a block 
device"
              else:
 -                status("All data on $dev will be destroyed")
+-                if confirm('Are you sure you wish to use this device'):
 +                warn("All data on {} will be destroyed!".format(dev))
-                 if confirm('Are you sure you wish to use this device'):
++                if confirm('Are you sure you wish to use this device?'):
                      dev_looks_sane = True
                  else:
+                     dev = ""
 -- 
-2.11.1
+2.12.0
 

++++++ 0007-medium-bootstrap-Set-expected_votes-based-on-actual-.patch ++++++
>From 03e673e76415590ef34cbf2d08dcfd3b530bb74a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <k...@koru.se>
Date: Mon, 10 Apr 2017 17:47:55 +0200
Subject: [PATCH] medium: bootstrap: Set expected_votes based on actual node
 count (bsc#1033288)

Initialize the cluster before setting expected_votes.

Query the cluster to find out how many nodes there are (so as
not to adjust multiple times if a previous attempt to join the
cluster failed).
---
 crmsh/bootstrap.py | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py
index 2b2e167a..bab3bd80 100644
--- a/crmsh/bootstrap.py
+++ b/crmsh/bootstrap.py
@@ -1240,17 +1240,39 @@ def join_cluster(seed_host):
     if is_unicast:
         corosync.add_node(utils.this_node())
 
-    # Increase expected_votes
-    new_quorum = 0
-    for v in corosync.get_values("quorum.expected_votes"):
-        new_quorum = int(v) + 1
-        corosync.set_value("quorum.expected_votes", str(new_quorum))
-    corosync.set_value("quorum.two_node", 1 if new_quorum == 2 else 0)
-    csync2_update(corosync.conf())
-
-    # ...now that that's out of the way, let's initialize the cluster.
+    # Initialize the cluster before adjusting quorum. This is so
+    # that we can query the cluster to find out how many nodes
+    # there are (so as not to adjust multiple times if a previous
+    # attempt to join the cluster failed)
     init_cluster_local()
 
+    def update_expected_votes():
+        # get a list of nodes, excluding remote nodes
+        nodelist = None
+        rc, nodelist_text = utils.get_stdout("cibadmin -Ql --xpath 
'/cib/status/node_state'")
+        if rc == 0:
+            try:
+                nodelist_xml = etree.fromstring(nodelist_text)
+                nodelist = [n.get('uname') for n in 
nodelist_xml.xpath('//node_state') if n.get('remote_node') != 'true']
+            except Exception:
+                pass
+
+        # Increase expected_votes
+        # TODO: wait to adjust expected_votes until after cluster join,
+        # so that we can ask the cluster for the current membership list
+        if nodelist is None:
+            nodecount = 0
+            for v in corosync.get_values("quorum.expected_votes"):
+                nodecount = int(v) + 1
+                corosync.set_value("quorum.expected_votes", str(nodecount))
+                corosync.set_value("quorum.two_node", 1 if nodecount == 2 else 
0)
+        else:
+            nodecount = len(nodelist)
+            corosync.set_value("quorum.expected_votes", str(nodecount))
+            corosync.set_value("quorum.two_node", 1 if nodecount == 2 else 0)
+        csync2_update(corosync.conf())
+    update_expected_votes()
+
     # Trigger corosync config reload to ensure expected_votes is propagated
     invoke("corosync-cfgtool -R")
 
-- 
2.12.0


Reply via email to