Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package crmsh for openSUSE:Factory checked 
in at 2023-03-06 18:56:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/crmsh (Old)
 and      /work/SRC/openSUSE:Factory/.crmsh.new.31432 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "crmsh"

Mon Mar  6 18:56:23 2023 rev:283 rq:1069564 version:4.4.1+20230306.0f04eb29

Changes:
--------
--- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes      2023-03-02 
23:04:29.864151935 +0100
+++ /work/SRC/openSUSE:Factory/.crmsh.new.31432/crmsh.changes   2023-03-06 
18:56:27.848944154 +0100
@@ -1,0 +2,15 @@
+Mon Mar 06 05:37:55 UTC 2023 - xli...@suse.com
+
+- Update to version 4.4.1+20230306.0f04eb29:
+  * Dev: bootstrap: Don't save core.debug when saving core.hosts
+  * Dev: behave: Adjust functional test for previous changes
+  * Dev: log: Redirect debug messages into stderr
+
+-------------------------------------------------------------------
+Fri Mar 03 04:14:46 UTC 2023 - xli...@suse.com
+
+- Update to version 4.4.1+20230303.0df99d8c:
+  * Dev: ChangeLog: update ChangeLog for release 4.5.0-rc1
+  * replace 2&>1 by 2>&1 and swap with >/dev/null
+
+-------------------------------------------------------------------

Old:
----
  crmsh-4.4.1+20230302.2b5310b9.tar.bz2

New:
----
  crmsh-4.4.1+20230306.0f04eb29.tar.bz2

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

Other differences:
------------------
++++++ crmsh.spec ++++++
--- /var/tmp/diff_new_pack.GagOd9/_old  2023-03-06 18:56:28.604948011 +0100
+++ /var/tmp/diff_new_pack.GagOd9/_new  2023-03-06 18:56:28.608948032 +0100
@@ -36,7 +36,7 @@
 Summary:        High Availability cluster command-line interface
 License:        GPL-2.0-or-later
 Group:          %{pkg_group}
-Version:        4.4.1+20230302.2b5310b9
+Version:        4.4.1+20230306.0f04eb29
 Release:        0
 URL:            http://crmsh.github.io
 Source0:        %{name}-%{version}.tar.bz2

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.GagOd9/_old  2023-03-06 18:56:28.656948277 +0100
+++ /var/tmp/diff_new_pack.GagOd9/_new  2023-03-06 18:56:28.660948298 +0100
@@ -9,7 +9,7 @@
 </service>
 <service name="tar_scm">
   <param name="url">https://github.com/ClusterLabs/crmsh.git</param>
-  <param 
name="changesrevision">e2961b896d4155fb6205fe9f6c628a572ae61f93</param>
+  <param 
name="changesrevision">1ea4e0874c84a6a5d03ee88465144ee72b81fe34</param>
 </service>
 </servicedata>
 (No newline at EOF)

++++++ crmsh-4.4.1+20230302.2b5310b9.tar.bz2 -> 
crmsh-4.4.1+20230306.0f04eb29.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh-4.4.1+20230302.2b5310b9/ChangeLog 
new/crmsh-4.4.1+20230306.0f04eb29/ChangeLog
--- old/crmsh-4.4.1+20230302.2b5310b9/ChangeLog 2023-03-02 07:05:25.000000000 
+0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/ChangeLog 2023-03-06 06:03:06.000000000 
+0100
@@ -1,3 +1,56 @@
+* Fri Mar 3 2023 Xin Liang <xli...@suse.com>
+- Release 4.5.0 rc1
+- Fix: qdevice: Unable to setup qdevice under non-root user (bsc#1208770)
+- Dev: upgradeutil: do upgrade silently (bsc#1208327)
+- Fix: bootstrap: `crm cluster join ssh` raises TypeError (bsc#1208327)
+- Dev: utils: Change the way to get pacemaker's version (bsc#1208216)
+- Dev: bootstrap: guess and ask whether to operate in non-root mode 
(jsc#PED-290)
+- Dev: bootstrap: allow the cluster to operate with ssh session under non-root 
sudoer (jsc#PED-290)
+- Fix: hawk fails to parse the slash (bsc#1206217)
+- Fix: extra logs while configuring passwordless (bsc#1207720)
+- Dev: utils: Check current user's privilege and give hints to user
+- Dev: ui_configure: Deprecate configure erase sub-command
+- Fix: report: Catch read exception (bsc#1206606)
+- Feature: replace root by a custom user with root privileges
+- Fix: bootstrap: Unset SBD_DELAY_START when running 'crm cluster start' 
(bsc#1202177)
+- Dev: ui_node: redirect `node delete` to `cluster remove`
+- Feature: bootstrap: Add option -x to skip csync2 initialization stage during 
the whole cluster bootstrap
+- Dev: parse: complete advised operation values for other actions beside 
monitor
+- Dev: ui_context: redirect `foo -h`/`foo --help` to `help foo` (bsc#1205735)
+- Fix: qdevice: Adjust SBD_WATCHDOG_TIMEOUT when configuring qdevice not using 
stage (bsc#1205727)
+- Fix: cibconfig: Complete promotable=true and interlave=true for 
Promoted/Unpromoted resource (bsc#1205522)
+- Fix: corosync: show corosync ring status if has fault (bsc#1205615)
+- Dev: bootstrap: fix passwordless ssh authentication for hacluster 
automatically when a new node is joining the cluster (bsc#1201785)
+- Dev: upgradeutil: automated init ssh passwordless auth for hacluster after 
upgrading (bsc#1201785)
+- Dev: parse: cli_to_xml: populate advised monitor/start/stop operations values
+- fix: log: fail to open log file even if user is in haclient group 
(bsc#1204670)
+- Fix: sbd: Ask if overwrite when given sbd device on interactive 
mode(bsc#1201428)
+- Dev: bootstrap: Adjust cluster properties including priority-fencing-delay
+- Fix: ui_cluster: 'crm cluster stop' failed to stop services (bsc#1203601)
+- Dev: bootstrap: Adjust pcmk_delay_max and stonith-timeout for all configured 
fence agents
+- Dev: cibconfig: "crm config show related:xxx" provides partial search among 
class, provider, type fields
+- Fix: crash_test: do not use firewalld to isolate a cluster node (bsc#1192467)
+- Dev: bootstrap: Add delay to start corosync when node list larger than 5
+- Dev: log: print begin and end marker in different lines in status_long
+- Dev: parallax: Add LogLevel=error ssh option to filter out warnings 
(bsc#1196726)
+- Revert "Fix: utils: Only raise exception when return code of systemctl 
command over ssh larger than 4 (bsc#1196726)" (bsc#1202655)
+- fix: configure: refresh cib before showing or modifying if no pending 
changes has been made (bsc#1202465)
+- Fix: bootstrap: Use crmsh.parallax instead of parallax module directly 
(bsc#1202006)
+
+* Wed Aug 10 2022 Xin Liang <xli...@suse.com>
+- tag: 4.4.1 for bug fix
+- Fix: utils: use -o and -n to compare files instead of strings for crm_diff 
(bsc#1201312)
+- Dev: bootstrap: remove cluster add sub-command
+- Fix: bootstrap: -N option setup the current node and peers all together 
(bsc#1175863)
+- Dev: doc: add help info for related: prefix for 'configure show' command
+- Dev: cinconfig: enable "related:" prefix to show the objects by given ra type
+- Fix: crm report: use sudo when under non root and hacluster user 
(bsc#1199634)
+- Fix: utils: wait4dc: Make change since output of 'crmadmin -S' 
changed(bsc#1199412)
+- Fix: bootstrap: stop and disable csync2.socket on removed node (bsc#1199325)
+- Fix: crm report: Read data in a save way, to avoid 
UnicodeDecodeError(bsc#1198180)
+- Fix: qdevice: Add lock to protect init_db_on_qnetd function (bsc#1197323)
+- Fix: utils: Only raise exception when return code of systemctl command over 
ssh larger than 4 (bsc#1196726)
+
 * Thu Feb 17 2022 Xin Liang <xli...@suse.com>
 - Release 4.4.0
 - Dev: README: update with unit tests steps
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh-4.4.1+20230302.2b5310b9/crmsh/log.py 
new/crmsh-4.4.1+20230306.0f04eb29/crmsh/log.py
--- old/crmsh-4.4.1+20230302.2b5310b9/crmsh/log.py      2023-03-02 
07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/crmsh/log.py      2023-03-06 
06:03:06.000000000 +0100
@@ -19,12 +19,12 @@
     """
     A custom handler for console
 
-    Redirect ERROR message to sys.stderr
-    Redirect INFO/WARNING/DEBUG message to sys.stdout
+    Redirect ERROR/WARNING/DEBUG message to sys.stderr
+    Redirect INFO message to sys.stdout
     """
 
     def emit(self, record):
-        if record.levelno < logging.ERROR:
+        if record.levelno == logging.INFO:
             stream = sys.stdout
         else:
             stream = sys.stderr
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh-4.4.1+20230302.2b5310b9/crmsh/main.py 
new/crmsh-4.4.1+20230306.0f04eb29/crmsh/main.py
--- old/crmsh-4.4.1+20230302.2b5310b9/crmsh/main.py     2023-03-02 
07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/crmsh/main.py     2023-03-06 
06:03:06.000000000 +0100
@@ -360,7 +360,7 @@
             options.batch = True
         user_args = parse_options()
         if config.core.debug:
-            print(utils.debug_timestamp())
+            logger.debug(utils.debug_timestamp())
         term.init()
         if options.profile:
             return profile_run(context, user_args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh-4.4.1+20230302.2b5310b9/crmsh/ui_cluster.py 
new/crmsh-4.4.1+20230306.0f04eb29/crmsh/ui_cluster.py
--- old/crmsh-4.4.1+20230302.2b5310b9/crmsh/ui_cluster.py       2023-03-02 
07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/crmsh/ui_cluster.py       2023-03-06 
06:03:06.000000000 +0100
@@ -689,7 +689,7 @@
         import time
         t0 = time.time()
         timeout = float(timeout)
-        cmd = 'crm_mon -bD1 2&>1 >/dev/null'
+        cmd = 'crm_mon -bD1 >/dev/null 2>&1'
         ret = utils.ext_cmd(cmd)
         while ret in (107, 64) and time.time() < t0 + timeout:
             time.sleep(1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh-4.4.1+20230302.2b5310b9/crmsh/utils.py 
new/crmsh-4.4.1+20230306.0f04eb29/crmsh/utils.py
--- old/crmsh-4.4.1+20230302.2b5310b9/crmsh/utils.py    2023-03-02 
07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/crmsh/utils.py    2023-03-06 
06:03:06.000000000 +0100
@@ -3485,8 +3485,13 @@
     def save_local(self):
         value = [f'{user}@{host}' for host, user in 
sorted(self._hosts_users.items(), key=lambda x: x[0])]
         config.set_option('core', 'hosts', value)
+        debug_on = config.get_option('core', 'debug')
+        if debug_on:
+            config.set_option('core', 'debug', 'false')
         # TODO: it is saved in ~root/.config/crm/crm.conf, is it as suitable 
path?
         config.save()
+        if debug_on:
+            config.set_option('core', 'debug', 'true')
 
     def save_remote(self, remote_hosts: typing.Iterable[str]):
         self.save_local()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crmsh-4.4.1+20230302.2b5310b9/data-manifest 
new/crmsh-4.4.1+20230306.0f04eb29/data-manifest
--- old/crmsh-4.4.1+20230302.2b5310b9/data-manifest     2023-03-02 
07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/data-manifest     2023-03-06 
06:03:06.000000000 +0100
@@ -111,6 +111,7 @@
 test/testcases/confbasic.exp
 test/testcases/confbasic-xml
 test/testcases/confbasic-xml.exp
+test/testcases/confbasic-xml.filter
 test/testcases/delete
 test/testcases/delete.exp
 test/testcases/edit
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-4.4.1+20230302.2b5310b9/test/features/qdevice_validate.feature 
new/crmsh-4.4.1+20230306.0f04eb29/test/features/qdevice_validate.feature
--- old/crmsh-4.4.1+20230302.2b5310b9/test/features/qdevice_validate.feature    
2023-03-02 07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/test/features/qdevice_validate.feature    
2023-03-06 06:03:06.000000000 +0100
@@ -131,7 +131,7 @@
     And     Service "corosync-qdevice" is "stopped" on "hanode1"
     When    Run "crm configure primitive d Dummy op monitor interval=3s" on 
"hanode1"
     When    Run "crm cluster init qdevice --qnetd-hostname=qnetd-node -y" on 
"hanode1"
-    Then    Expected "WARNING: To use qdevice service, need to restart cluster 
service manually on each node" in stdout
+    Then    Expected "WARNING: To use qdevice service, need to restart cluster 
service manually on each node" in stderr
     And     Service "corosync-qdevice" is "stopped" on "hanode1"
     When    Run "crm cluster restart" on "hanode1"
     Then    Service "corosync-qdevice" is "started" on "hanode1"
@@ -153,7 +153,7 @@
     And     Service "corosync-qdevice" is "started" on "hanode1"
     When    Run "crm configure primitive d Dummy op monitor interval=3s" on 
"hanode1"
     When    Run "crm cluster remove --qdevice -y" on "hanode1"
-    Then    Expected "WARNING: To remove qdevice service, need to restart 
cluster service manually on each node" in stdout
+    Then    Expected "WARNING: To remove qdevice service, need to restart 
cluster service manually on each node" in stderr
     Then    Cluster service is "started" on "hanode1"
     And     Service "corosync-qdevice" is "started" on "hanode1"
     When    Run "crm cluster restart" on "hanode1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-4.4.1+20230302.2b5310b9/test/features/resource_set.feature 
new/crmsh-4.4.1+20230306.0f04eb29/test/features/resource_set.feature
--- old/crmsh-4.4.1+20230302.2b5310b9/test/features/resource_set.feature        
2023-03-02 07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/test/features/resource_set.feature        
2023-03-06 06:03:06.000000000 +0100
@@ -107,13 +107,13 @@
   @clean
   Scenario: operation warning
     When    Run "crm configure primitive id=d2 Dummy op start interval=5s" on 
"hanode1"
-    Then    Expected "WARNING: d2: Specified interval for start is 5s, it must 
be 0" in stdout
+    Then    Expected "WARNING: d2: Specified interval for start is 5s, it must 
be 0" in stderr
     When    Run "crm configure primitive id=d3 Dummy op monitor interval=0" on 
"hanode1"
-    Then    Expected "WARNING: d3: interval in monitor should be larger than 
0, advised is 10s" in stdout
+    Then    Expected "WARNING: d3: interval in monitor should be larger than 
0, advised is 10s" in stderr
     When    Run "crm configure primitive s2 ocf:pacemaker:Stateful op monitor 
role=Promoted interval=3s op monitor role=Unpromoted interval=3s" on "hanode1"
-    Then    Expected "WARNING: s2: interval in monitor must be unique, advised 
is 11s" in stdout
+    Then    Expected "WARNING: s2: interval in monitor must be unique, advised 
is 11s" in stderr
     When    Run "crm configure primitive id=d4 Dummy op start timeout=10s" on 
"hanode1"
-    Then    Expected "WARNING: d4: specified timeout 10s for start is smaller 
than the advised 20s" in stdout
+    Then    Expected "WARNING: d4: specified timeout 10s for start is smaller 
than the advised 20s" in stderr
 
   @clean
   Scenario: trace ra with specific directory
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-4.4.1+20230302.2b5310b9/test/features/steps/step_implementation.py 
new/crmsh-4.4.1+20230306.0f04eb29/test/features/steps/step_implementation.py
--- 
old/crmsh-4.4.1+20230302.2b5310b9/test/features/steps/step_implementation.py    
    2023-03-02 07:05:25.000000000 +0100
+++ 
new/crmsh-4.4.1+20230306.0f04eb29/test/features/steps/step_implementation.py    
    2023-03-06 06:03:06.000000000 +0100
@@ -58,7 +58,7 @@
 
 @given('Has disk "{disk}" on "{addr}"')
 def step_impl(context, disk, addr):
-    out = run_command_local_or_remote(context, "fdisk -l", addr)
+    _, out, _ = run_command_local_or_remote(context, "fdisk -l", addr)
     assert re.search(r'{} '.format(disk), out) is not None
 
 
@@ -69,19 +69,19 @@
 
 @given('Run "{cmd}" OK')
 def step_impl(context, cmd):
-    rc, _, = run_command(context, cmd)
+    rc, _, _ = run_command(context, cmd)
     assert rc == 0
 
 
 @then('Run "{cmd}" OK')
 def step_impl(context, cmd):
-    rc, _, = run_command(context, cmd)
+    rc, _, _ = run_command(context, cmd)
     assert rc == 0
 
 
 @when('Run "{cmd}" OK')
 def step_impl(context, cmd):
-    rc, _, = run_command(context, cmd)
+    rc, _, _ = run_command(context, cmd)
     assert rc == 0
 
 
@@ -94,8 +94,7 @@
 
 @when('Run "{cmd}" on "{addr}"')
 def step_impl(context, cmd, addr):
-    out = run_command_local_or_remote(context, cmd, addr)
-    context.stdout = out
+    _, out, _ = run_command_local_or_remote(context, cmd, addr)
 
 
 @then('Print stdout')
@@ -105,18 +104,17 @@
 
 @then('Print stderr')
 def step_impl(context):
-    context.logger.info("\n{}".format(context.command_error_output))
+    context.logger.info("\n{}".format(context.stderr))
 
 
 @when('Try "{cmd}" on "{addr}"')
 def step_impl(context, cmd, addr):
-    run_command_local_or_remote(context, cmd, addr, err_record=True)
+    run_command_local_or_remote(context, cmd, addr, exit_on_fail=False)
 
 
 @when('Try "{cmd}"')
 def step_impl(context, cmd):
-    rc, out = run_command(context, cmd, err_record=True)
-    context.return_code = rc
+    _, out, _ = run_command(context, cmd, exit_on_fail=False)
 
 
 @when('Wait "{second}" seconds')
@@ -142,6 +140,12 @@
     context.stdout = None
 
 
+@then('Expected "{msg}" in stderr')
+def step_impl(context, msg):
+    assert msg in context.stderr
+    context.stderr = None
+
+
 @then('Expected regrex "{reg_str}" in stdout')
 def step_impl(context, reg_str):
     res = re.search(reg_str, context.stdout)
@@ -162,14 +166,14 @@
 
 @then('Except "{msg}"')
 def step_impl(context, msg):
-    assert msg in context.command_error_output
-    context.command_error_output = None
+    assert msg in context.stderr
+    context.stderr = None
 
 
 @then('Except multiple lines')
 def step_impl(context):
-    assert context.command_error_output.split('\n') == context.text.split('\n')
-    context.command_error_output = None
+    assert context.text in context.stderr
+    context.stderr = None
 
 
 @then('Expected multiple lines in output')
@@ -180,8 +184,8 @@
 
 @then('Except "{msg}" in stderr')
 def step_impl(context, msg):
-    assert msg in context.command_error_output
-    context.command_error_output = None
+    assert msg in context.stderr
+    context.stderr = None
 
 
 @then('Cluster service is "{state}" on "{addr}"')
@@ -211,20 +215,20 @@
 
 @then('IP "{addr}" is used by corosync on "{node}"')
 def step_impl(context, addr, node):
-    out = run_command_local_or_remote(context, 'corosync-cfgtool -s', node)
+    _, out, _ = run_command_local_or_remote(context, 'corosync-cfgtool -s', 
node)
     res = re.search(r' {}\n'.format(addr), out)
     assert bool(res) is True
 
 
 @then('Cluster name is "{name}"')
 def step_impl(context, name):
-    _, out = run_command(context, 'corosync-cmapctl -b totem.cluster_name')
+    _, out, _ = run_command(context, 'corosync-cmapctl -b totem.cluster_name')
     assert out.split()[-1] == name
 
 
 @then('Cluster virtual IP is "{addr}"')
 def step_impl(context, addr):
-    _, out = run_command(context, 'crm configure show|grep -A1 IPaddr2')
+    _, out, _ = run_command(context, 'crm configure show|grep -A1 IPaddr2')
     res = re.search(r' ip={}'.format(addr), out)
     assert bool(res) is True
 
@@ -236,35 +240,35 @@
 
 @then('Show cluster status on "{addr}"')
 def step_impl(context, addr):
-    out = run_command_local_or_remote(context, 'crm_mon -1', addr)
+    _, out, _ = run_command_local_or_remote(context, 'crm_mon -1', addr)
     if out:
         context.logger.info("\n{}".format(out))
 
 
 @then('Show corosync ring status')
 def step_impl(context):
-    _, out = run_command(context, 'crm corosync status ring')
+    _, out, _ = run_command(context, 'crm corosync status ring')
     if out:
         context.logger.info("\n{}".format(out))
 
 
 @then('Show crm configure')
 def step_impl(context):
-    _, out = run_command(context, 'crm configure show')
+    _, out, _ = run_command(context, 'crm configure show')
     if out:
         context.logger.info("\n{}".format(out))
 
 
 @then('Show status from qnetd')
 def step_impl(context):
-    _, out = run_command(context, 'crm corosync status qnetd')
+    _, out, _ = run_command(context, 'crm corosync status qnetd')
     if out:
         context.logger.info("\n{}".format(out))
 
 
 @then('Show corosync qdevice configuration')
 def step_impl(context):
-    _, out = run_command(context, "sed -n -e '/quorum/,/^}/ p' 
/etc/corosync/corosync.conf")
+    _, out, _ = run_command(context, "sed -n -e '/quorum/,/^}/ p' 
/etc/corosync/corosync.conf")
     if out:
         context.logger.info("\n{}".format(out))
 
@@ -275,7 +279,7 @@
     result = None
     while try_count < 20:
         time.sleep(1)
-        _, out = run_command(context, "crm_mon -1rR")
+        _, out, _ = run_command(context, "crm_mon -1rR")
         if out:
             result = re.search(r'\s{}\s+.*:+{}\):\s+{} '.format(res, res_type, 
state), out)
             if not result:
@@ -288,7 +292,7 @@
 @then('Resource "{res}" failcount on "{node}" is "{number}"')
 def step_impl(context, res, node, number):
     cmd = "crm resource failcount {} show {}".format(res, node)
-    _, out = run_command(context, cmd)
+    _, out, _ = run_command(context, cmd)
     if out:
         result = re.search(r'name=fail-count-{} value={}'.format(res, number), 
out)
         assert result is not None
@@ -296,7 +300,7 @@
 
 @then('Resource "{res_type}" not configured')
 def step_impl(context, res_type):
-    _, out = run_command(context, "crm configure show")
+    _, out, _ = run_command(context, "crm configure show")
     result = re.search(r' {} '.format(res_type), out)
     assert result is None
 
@@ -358,7 +362,7 @@
 @then('File "{f}" was synced in cluster')
 def step_impl(context, f):
     cmd = "crm cluster diff {}".format(f)
-    rc, out = run_command(context, cmd)
+    rc, out, _ = run_command(context, cmd)
     assert_eq("", out)
 
 
@@ -402,14 +406,14 @@
 
 @then('Parameter "{param_name}" not configured in "{res_id}"')
 def step_impl(context, param_name, res_id):
-    _, out = run_command(context, "crm configure show {}".format(res_id))
+    _, out, _ = run_command(context, "crm configure show {}".format(res_id))
     result = re.search("params {}=".format(param_name), out)
     assert result is None
 
 
 @then('Parameter "{param_name}" configured in "{res_id}"')
 def step_impl(context, param_name, res_id):
-    _, out = run_command(context, "crm configure show {}".format(res_id))
+    _, out, _ = run_command(context, "crm configure show {}".format(res_id))
     result = re.search("params {}=".format(param_name), out)
     assert result is not None
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-4.4.1+20230302.2b5310b9/test/features/steps/utils.py 
new/crmsh-4.4.1+20230306.0f04eb29/test/features/steps/utils.py
--- old/crmsh-4.4.1+20230302.2b5310b9/test/features/steps/utils.py      
2023-03-02 07:05:25.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/test/features/steps/utils.py      
2023-03-06 06:03:06.000000000 +0100
@@ -7,6 +7,9 @@
 from crmsh import utils, bootstrap, parallax
 
 
+COLOR_MODE = r'\x1b\[[0-9]+m'
+
+
 def get_file_type(file_path):
     rc, out, _ = utils.get_stdout_stderr("file {}".format(file_path))
     if re.search(r'{}: bzip2'.format(file_path), out):
@@ -43,38 +46,41 @@
     return cmd
 
 
-def run_command(context, cmd, err_record=False):
+def run_command(context, cmd, exit_on_fail=True):
     rc, out, err = utils.get_stdout_stderr(add_sudo(cmd))
-    if rc != 0 and err:
-        if err_record:
-            res = re.sub(r'\x1b\[[0-9]+m', '', err)
-            context.command_error_output = res
-            return rc, re.sub(r'\x1b\[[0-9]+m', '', out)
+    context.return_code = rc
+    if out:
+        out = re.sub(COLOR_MODE, '', out)
+        context.stdout = out
+    if err:
+        err = re.sub(COLOR_MODE, '', err)
+        context.stderr = err
+    if rc != 0 and exit_on_fail:
         if out:
             context.logger.info("\n{}\n".format(out))
         context.logger.error("\n{}\n".format(err))
         context.failed = True
-    return rc, re.sub(r'\x1b\[[0-9]+m', '', out)
+    return rc, out, err
 
 
-def run_command_local_or_remote(context, cmd, addr, err_record=False):
+def run_command_local_or_remote(context, cmd, addr, exit_on_fail=True):
     cmd = add_sudo(cmd)
     if addr == me():
-        rc, out = run_command(context, cmd, err_record)
-        context.return_code = rc
-        return out
+        return run_command(context, cmd, exit_on_fail)
     else:
         try:
             results = parallax.parallax_call(addr.split(','), cmd)
         except ValueError as err:
-            if err_record:
-                context.command_error_output = re.sub(r'\x1b\[[0-9]+m', '', 
str(err))
-                return
-            context.logger.error("\n{}\n".format(err))
-            context.failed = True
+            err = re.sub(COLOR_MODE, '', str(err))
+            context.stderr = err
+            if exit_on_fail:
+                context.logger.error("\n{}\n".format(err))
+                context.failed = True
         else:
+            out = utils.to_ascii(results[0][1][1])
+            context.stdout = out
             context.return_code = 0
-            return utils.to_ascii(results[0][1][1])
+            return 0, out, None
 
 
 def check_service_state(context, service_name, state, addr):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/crmsh-4.4.1+20230302.2b5310b9/test/testcases/confbasic-xml.filter 
new/crmsh-4.4.1+20230306.0f04eb29/test/testcases/confbasic-xml.filter
--- old/crmsh-4.4.1+20230302.2b5310b9/test/testcases/confbasic-xml.filter       
1970-01-01 01:00:00.000000000 +0100
+++ new/crmsh-4.4.1+20230306.0f04eb29/test/testcases/confbasic-xml.filter       
2023-03-06 06:03:06.000000000 +0100
@@ -0,0 +1,2 @@
+#!/bin/bash
+grep -v "WARNING"

Reply via email to