commit crmsh for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package crmsh for openSUSE:Factory checked in at 2025-01-05 15:29:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/crmsh (Old) and /work/SRC/openSUSE:Factory/.crmsh.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "crmsh" Sun Jan 5 15:29:37 2025 rev:352 rq:1234651 version:5.0.0+20250103.44145ae9 Changes: -------- --- /work/SRC/openSUSE:Factory/crmsh/crmsh.changes 2024-12-30 12:52:31.082058412 +0100 +++ /work/SRC/openSUSE:Factory/.crmsh.new.1881/crmsh.changes 2025-01-05 15:29:44.418020874 +0100 @@ -1,0 +2,25 @@ +Fri Jan 03 04:41:48 UTC 2025 - XLiang@suse.com + +- Update to version 5.0.0+20250103.44145ae9: + * Dev: unittests: Adjust unit test for previous commit + * Fix: bootstrap: Improve sync_files_to_disk function (bsc#1219537) + +------------------------------------------------------------------- +Thu Jan 02 10:51:14 UTC 2025 - XLiang@suse.com + +- Update to version 5.0.0+20250102.150f4c85: + * Fix: unittest: rename TestPrinter to UnitTestPrinter + +------------------------------------------------------------------- +Thu Jan 02 08:17:29 UTC 2025 - XLiang@suse.com + +- Update to version 5.0.0+20250102.24021985: + * Dev: unittests: Rewrite test_findln_by_timestamp by using fixed date + +------------------------------------------------------------------- +Mon Dec 30 12:48:14 UTC 2024 - XLiang@suse.com + +- Update to version 5.0.0+20241230.14da5227: + * Dev: ra: Drop legacy code to get metadata of the pacemaker daemons + +------------------------------------------------------------------- Old: ---- crmsh-5.0.0+20241230.aae750fc.tar.bz2 New: ---- crmsh-5.0.0+20250103.44145ae9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ crmsh.spec ++++++ --- /var/tmp/diff_new_pack.BUVKI6/_old 2025-01-05 15:29:45.006045060 +0100 +++ /var/tmp/diff_new_pack.BUVKI6/_new 2025-01-05 15:29:45.010045225 +0100 @@ -36,7 +36,7 @@ Summary: High Availability cluster command-line interface License: GPL-2.0-or-later Group: %{pkg_group} -Version: 5.0.0+20241230.aae750fc +Version: 5.0.0+20250103.44145ae9 Release: 0 URL: http://crmsh.github.io Source0: %{name}-%{version}.tar.bz2 ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.BUVKI6/_old 2025-01-05 15:29:45.062047364 +0100 +++ /var/tmp/diff_new_pack.BUVKI6/_new 2025-01-05 15:29:45.066047528 +0100 @@ -9,7 +9,7 @@ </service> <service name="tar_scm"> <param name="url">https://github.com/ClusterLabs/crmsh.git</param> - <param name="changesrevision">7ceabf7fa2185cf308c9f65745d4fb18edbf930a</param> + <param name="changesrevision">44145ae9a0bfa264864d853696e0e0a49836c8cb</param> </service> </servicedata> (No newline at EOF) ++++++ crmsh-5.0.0+20241230.aae750fc.tar.bz2 -> crmsh-5.0.0+20250103.44145ae9.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-5.0.0+20241230.aae750fc/crmsh/bootstrap.py new/crmsh-5.0.0+20250103.44145ae9/crmsh/bootstrap.py --- old/crmsh-5.0.0+20241230.aae750fc/crmsh/bootstrap.py 2024-12-30 04:06:28.000000000 +0100 +++ new/crmsh-5.0.0+20250103.44145ae9/crmsh/bootstrap.py 2025-01-03 05:09:33.000000000 +0100 @@ -1882,9 +1882,22 @@ """ Sync file content to disk between cluster nodes """ - files_string = ' '.join(filter(lambda f: os.path.isfile(f), FILES_TO_SYNC)) - if files_string: - utils.cluster_run_cmd("sync {}".format(files_string.strip())) + target_files_str = "" + + for f in FILES_TO_SYNC: + # check if the file exists on the local node + if not os.path.isfile(f): + continue + try: + # check if the file exists on the remote node + utils.cluster_run_cmd(f"test -f {f}") + except ValueError: + continue + else: + target_files_str += f + " " + + if target_files_str: + utils.cluster_run_cmd(f"sync {target_files_str.strip()}") def detect_mountpoint(seed_host: str) -> None: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-5.0.0+20241230.aae750fc/crmsh/cibconfig.py new/crmsh-5.0.0+20250103.44145ae9/crmsh/cibconfig.py --- old/crmsh-5.0.0+20241230.aae750fc/crmsh/cibconfig.py 2024-12-30 04:06:28.000000000 +0100 +++ new/crmsh-5.0.0+20250103.44145ae9/crmsh/cibconfig.py 2025-01-03 05:09:33.000000000 +0100 @@ -24,7 +24,7 @@ from . import crm_gv from . import ui_utils from . import userdir -from .ra import get_ra, get_properties_list, get_pe_meta, get_properties_meta, RAInfo, get_resource_meta_list +from .ra import get_ra, get_properties_list, get_properties_meta, RAInfo, get_resource_meta_list from .utils import ext_cmd, safe_open_w, pipe_string, safe_close_w, crm_msec from .utils import ask, lines2cli, olist from .utils import page_string, str2tmp, ensure_sudo_readable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-5.0.0+20241230.aae750fc/crmsh/ra.py new/crmsh-5.0.0+20250103.44145ae9/crmsh/ra.py --- old/crmsh-5.0.0+20241230.aae750fc/crmsh/ra.py 2024-12-30 04:06:28.000000000 +0100 +++ new/crmsh-5.0.0+20250103.44145ae9/crmsh/ra.py 2025-01-03 05:09:33.000000000 +0100 @@ -186,39 +186,19 @@ @utils.memoize -def get_pe_meta(): - return RAInfo(utils.pacemaker_schedulerd(), "metadata") - - -@utils.memoize -def get_crmd_meta(): - return RAInfo(utils.pacemaker_controld(), "metadata", - exclude_from_completion=constants.controld_metadata_do_not_complete) - - -@utils.memoize def get_stonithd_meta(): return RAInfo(utils.pacemaker_fenced(), "metadata") @utils.memoize -def get_cib_meta(): - return RAInfo(utils.pacemaker_based(), "metadata") - - -@utils.memoize def get_properties_meta(): cluster_option_meta = utils.get_cluster_option_metadata() if cluster_option_meta: return RAInfo("cluster_option", None, exclude_from_completion=constants.controld_metadata_do_not_complete, meta_string=cluster_option_meta) - # get_xxx_meta() is a legacy code to get the metadata of the pacemaker daemons, - # which will be dropped when we fully adopt to crmsh-5.x with pacemaker 3.x. - meta = copy.deepcopy(get_crmd_meta()) - meta.add_ra_params(get_pe_meta()) - meta.add_ra_params(get_cib_meta()) - return meta + else: + raise ValueError("No cluster option metadata found") @utils.memoize diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-5.0.0+20241230.aae750fc/test/unittests/test_bootstrap.py new/crmsh-5.0.0+20250103.44145ae9/test/unittests/test_bootstrap.py --- old/crmsh-5.0.0+20241230.aae750fc/test/unittests/test_bootstrap.py 2024-12-30 04:06:28.000000000 +0100 +++ new/crmsh-5.0.0+20250103.44145ae9/test/unittests/test_bootstrap.py 2025-01-03 05:09:33.000000000 +0100 @@ -1323,7 +1323,11 @@ mock_isfile.side_effect = [True, True] bootstrap.sync_files_to_disk() mock_isfile.assert_has_calls([mock.call("file1"), mock.call("file2")]) - mock_cluster_cmd.assert_called_once_with("sync file1 file2") + mock_cluster_cmd.assert_has_calls([ + mock.call("test -f file1"), + mock.call("test -f file2"), + mock.call("sync file1 file2") + ]) @mock.patch('logging.Logger.debug') @mock.patch('crmsh.sh.ClusterShell.get_stdout_or_raise_error') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-5.0.0+20241230.aae750fc/test/unittests/test_report_utils.py new/crmsh-5.0.0+20250103.44145ae9/test/unittests/test_report_utils.py --- old/crmsh-5.0.0+20241230.aae750fc/test/unittests/test_report_utils.py 2024-12-30 04:06:28.000000000 +0100 +++ new/crmsh-5.0.0+20250103.44145ae9/test/unittests/test_report_utils.py 2025-01-03 05:09:33.000000000 +0100 @@ -1,5 +1,7 @@ +import os import sys import datetime +import tempfile from crmsh import config from crmsh import utils as crmutils from crmsh.report import utils, constants @@ -807,24 +809,37 @@ self.assertIsNone(result_line) def test_findln_by_timestamp(self): - target_time = "Apr 03 13:10" - this_year = datetime.datetime.now().year - target_time_stamp = crmutils.parse_to_timestamp(target_time+' '+str(this_year)) - with open('pacemaker.log') as f: - data = f.read() - constants.STAMP_TYPE = utils.determin_log_format(data) - pacemaker_file_path = "pacemaker.log" - result_line = utils.findln_by_timestamp(data, target_time_stamp, pacemaker_file_path) - result_line_stamp = utils.get_timestamp(data.split('\n')[result_line-1], pacemaker_file_path) - assert result_line_stamp > target_time_stamp - result_pre_line_stamp = utils.get_timestamp(data.split('\n')[result_line-2], pacemaker_file_path) - assert result_pre_line_stamp < target_time_stamp - - target_time = "Apr 03 11:01:19" - target_time_stamp = crmutils.parse_to_timestamp(target_time+' '+str(this_year)) - result_line = utils.findln_by_timestamp(data, target_time_stamp, pacemaker_file_path) - result_time = ' '.join(data.split('\n')[result_line-1].split()[:3]) - self.assertEqual(result_time, target_time) + data = """2024-04-03T11:01:00Z example-host app-name 1234 ID123 - - This is a log message before the target timestamp (11:01:19). +2024-04-03T11:01:19Z example-host app-name 1234 ID123 - - This is the log message exactly at the target timestamp (11:01:19). +2024-04-03T11:01:40Z example-host app-name 1234 ID123 - - This is a log message after the target timestamp (11:01:19). +2024-04-03T13:09:50Z example-host app-name 1234 ID123 - - This is a log message before the target timestamp (13:10). +2024-04-03T13:10:00Z example-host app-name 1234 ID123 - - This is the log message exactly at the target timestamp (13:10). +2024-04-03T13:10:30Z example-host app-name 1234 ID123 - - This is a log message after the target timestamp (13:10).""" + with tempfile.NamedTemporaryFile(delete=False) as f: + temp_file_path = f.name + f.write(data.encode()) + try: + target_time = "2024-04-03T13:00:20Z" + target_time_stamp = crmutils.parse_to_timestamp(target_time) + constants.STAMP_TYPE = utils.determin_log_format(data) + result_line = utils.findln_by_timestamp(data, target_time_stamp, temp_file_path) + assert result_line == 4 + + line_data = data.split('\n')[result_line-1].split()[0] + result_line_stamp = crmutils.parse_to_timestamp(line_data) + assert result_line_stamp > target_time_stamp + + pre_line_data = data.split('\n')[result_line-2].split()[0] + result_pre_line_stamp = crmutils.parse_to_timestamp(pre_line_data) + assert result_pre_line_stamp < target_time_stamp + + target_time = "2024-04-03T11:01:19Z" + target_time_stamp = crmutils.parse_to_timestamp(target_time) + result_line = utils.findln_by_timestamp(data, target_time_stamp, temp_file_path) + line_data = data.split('\n')[result_line-1].split()[0] + self.assertEqual(line_data, target_time) + finally: + os.remove(temp_file_path) @mock.patch('crmsh.utils.parse_to_timestamp') def test_get_timestamp_from_time_line_not_syslog(self, mock_parse): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/crmsh-5.0.0+20241230.aae750fc/test/unittests/test_scripts.py new/crmsh-5.0.0+20250103.44145ae9/test/unittests/test_scripts.py --- old/crmsh-5.0.0+20241230.aae750fc/test/unittests/test_scripts.py 2024-12-30 04:06:28.000000000 +0100 +++ new/crmsh-5.0.0+20250103.44145ae9/test/unittests/test_scripts.py 2025-01-03 05:09:33.000000000 +0100 @@ -1,5 +1,3 @@ -from __future__ import print_function -from __future__ import unicode_literals # Copyright (C) 2014 Kristoffer Gronlund <kgronlund@suse.com> # See COPYING for license information. @@ -820,7 +818,7 @@ assert 'primitive bar IPaddr2 ip=192.168.0.15\ngroup g-foo foo bar' == actions[-1]['text'].strip() -class TestPrinter(object): +class UnitTestPrinter: def __init__(self): import types self.actions = [] @@ -860,7 +858,7 @@ assert len(actions) == 1 assert actions[0]['name'] == 'call' assert actions[0]['value'] == '#!/bin/sh\necho "hello world"' - tp = TestPrinter() + tp = UnitTestPrinter() scripts.run(script_a, {"foo": "hello world"}, tp)
participants (1)
-
Source-Sync