Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2017-03-16 09:42:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "crmsh" Thu Mar 16 09:42:39 2017 rev:117 rq:479431 version:3.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2017-03-02 19:38:14.475946197 +0100 +++ /work/SRC/openSUSE:Factory/.crmsh.new/crmsh.changes 2017-03-16 09:51:35.897254393 +0100 @@ -1,0 +2,10 @@ +Wed Mar 15 07:04:44 UTC 2017 - kgronlund@suse.com + +- low: bootstrap: Fix warning for formatting SBD device (bsc#1028704) +- medium: ui_cluster: Fix init with no arguments (bsc#1028735) +- low: utils: Use /proc for process discovery +- Add 0002-low-bootstrap-Fix-warning-for-formatting-SBD-device-.patch +- Add 0003-medium-ui_cluster-Fix-init-with-no-arguments-bsc-102.patch +- Add 0004-low-utils-Use-proc-for-process-discovery.patch + +------------------------------------------------------------------- New: ---- 0002-low-bootstrap-Fix-warning-for-formatting-SBD-device-.patch 0003-medium-ui_cluster-Fix-init-with-no-arguments-bsc-102.patch 0004-low-utils-Use-proc-for-process-discovery.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.mdASVE/_old 2017-03-16 09:51:36.489170567 +0100 +++ /var/tmp/diff_new_pack.mdASVE/_new 2017-03-16 09:51:36.489170567 +0100 @@ -44,6 +44,13 @@ Source0: %{name}-%{version}.tar.bz2 # PATCH-FIX-UPSTREAM: Allow empty fencing topology (bsc#1025393) Patch1: 0001-Allow-empty-fencing_topology-bsc-1025393.patch +# PATCH-FIX-UPSTREAM: low: bootstrap: Fix warning for formatting SBD device (bsc#1028704) +Patch2: 0002-low-bootstrap-Fix-warning-for-formatting-SBD-device-.patch +# PATCH-FIX-UPSTREAM: medium: ui_cluster: Fix init with no arguments (bsc#1028735) +Patch3: 0003-medium-ui_cluster-Fix-init-with-no-arguments-bsc-102.patch +# PATCH-FIX-UPSTREAM: low: utils: Use /proc for process discovery +Patch4: 0004-low-utils-Use-proc-for-process-discovery.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{?suse_version} # Requiring pacemaker makes crmsh harder to build on other distributions, @@ -146,6 +153,9 @@ %prep %setup -q %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 # Force the local time # ++++++ 0002-low-bootstrap-Fix-warning-for-formatting-SBD-device-.patch ++++++
From 6bbb4fba305d8eeb921b63f579d9703c633ed7ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?=
Date: Thu, 9 Mar 2017 20:27:19 +0100 Subject: [PATCH 2/4] low: bootstrap: Fix warning for formatting SBD device (bsc#1028704)
--- crmsh/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py index 2b2e167a..26d5f124 100644 --- a/crmsh/bootstrap.py +++ b/crmsh/bootstrap.py @@ -940,7 +940,7 @@ 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") + warn("All data on {} will be destroyed!".format(dev)) if confirm('Are you sure you wish to use this device'): dev_looks_sane = True else: -- 2.11.1 ++++++ 0003-medium-ui_cluster-Fix-init-with-no-arguments-bsc-102.patch ++++++
From 5ea0f8480fc7bb9894e0581ef3e0afa3b3ea11e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?=
Date: Thu, 9 Mar 2017 21:49:09 +0100 Subject: [PATCH 3/4] medium: ui_cluster: Fix init with no arguments (bsc#1028735)
--- crmsh/ui_cluster.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crmsh/ui_cluster.py b/crmsh/ui_cluster.py index 762e6bfd..6b143c35 100644 --- a/crmsh/ui_cluster.py +++ b/crmsh/ui_cluster.py @@ -104,8 +104,9 @@ class Cluster(command.UI): def looks_like_hostnames(lst): sectionlist = bootstrap.INIT_STAGES return all(not (l.startswith('-') or l in sectionlist) for l in lst) - if '--dry-run' in args or looks_like_hostnames(args): - args = ['--yes', '--nodes'] + [arg for arg in args if arg != '--dry-run'] + if len(args) > 0: + if '--dry-run' in args or looks_like_hostnames(args): + args = ['--yes', '--nodes'] + [arg for arg in args if arg != '--dry-run'] parser = OptParser(usage="usage: init [options] [STAGE]", epilog=""" Stage can be one of: -- 2.11.1 ++++++ 0004-low-utils-Use-proc-for-process-discovery.patch ++++++
From 931abc46808ff427134031765835fb3f803a40ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?=
Date: Thu, 16 Feb 2017 13:51:08 +0100 Subject: [PATCH 4/4] low: utils: Use /proc for process discovery
Parsing ps output turns out to be tricky, so use the /proc filesystem for process discovery instead. Fixes: #182 --- crmsh/utils.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/crmsh/utils.py b/crmsh/utils.py index e48cef59..8b2d48d3 100644 --- a/crmsh/utils.py +++ b/crmsh/utils.py @@ -952,14 +952,25 @@ def is_int(s): def is_process(s): - cmd = "ps -e -o pid,command | grep -qs '%s'" % s - if options.regression_tests: - print ".EXT", cmd - proc = subprocess.Popen(cmd, - shell=True, - stdout=subprocess.PIPE) - proc.wait() - return proc.returncode == 0 + """ + Returns true if argument is the name of a running process. + + s: process name + returns Boolean + """ + from os.path import join, basename + # find pids of running processes + pids = [pid for pid in os.listdir('/proc') if pid.isdigit()] + for pid in pids: + try: + cmdline = open(join('/proc', pid, 'cmdline'), 'rb').read() + procname = basename(cmdline.replace('\x00', ' ').split(' ')[0]) + if procname == s: + return True + except os.error: + # a process may have died since we got the list of pids + pass + return False def print_stacktrace(): -- 2.11.1