From 57c2c4d635957e840e2e812ac50ffa4a3eb13dbd Mon Sep 17 00:00:00 2001 From: Maurizio Lombardi Date: Wed, 22 Oct 2025 10:50:09 +0200 Subject: [PATCH] Fix a syntax warning when running in image mode Resolves: RHEL-78512 Signed-off-by: Maurizio Lombardi --- .fmf/version | 1 + plans/sts.fmf | 4 ++++ regex.patch | 13 +++++++++++++ targetcli.spec | 8 ++++++-- tests/provision.fmf | 5 ----- tests/tests.yml | 27 --------------------------- 6 files changed, 24 insertions(+), 34 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/sts.fmf create mode 100644 regex.patch delete mode 100644 tests/provision.fmf delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/sts.fmf b/plans/sts.fmf new file mode 100644 index 0000000..6632211 --- /dev/null +++ b/plans/sts.fmf @@ -0,0 +1,4 @@ +plan: + import: + url: https://gitlab.com/rh-kernel-stqe/sts + name: /plans/lio/core diff --git a/regex.patch b/regex.patch new file mode 100644 index 0000000..75a54e8 --- /dev/null +++ b/regex.patch @@ -0,0 +1,13 @@ +diff --git a/targetcli/ui_root.py b/targetcli/ui_root.py +index 79ee985..4e40aa3 100644 +--- a/targetcli/ui_root.py ++++ b/targetcli/ui_root.py +@@ -160,7 +160,7 @@ class UIRoot(UINode): + + try: + with open(universal_prefs_file) as prefs: +- backups = [line for line in prefs.read().splitlines() if re.match('^max_backup_files\s*=', line)] ++ backups = [line for line in prefs.read().splitlines() if re.match(r'^max_backup_files\s*=', line)] + if max_backup_files < int(backups[0].split('=')[1].strip()): + max_backup_files = int(backups[0].split('=')[1].strip()) + except: diff --git a/targetcli.spec b/targetcli.spec index ae3b103..2631676 100644 --- a/targetcli.spec +++ b/targetcli.spec @@ -4,7 +4,7 @@ Name: targetcli License: ASL 2.0 Summary: An administration shell for storage targets Version: 2.1.58 -Release: 3%{?dist} +Release: 4%{?dist} URL: https://github.com/open-iscsi/%{oname} Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz # Proposed upstream @@ -13,7 +13,7 @@ BuildArch: noarch BuildRequires: python3-devel, python3-setuptools, systemd-rpm-macros Requires: python3-rtslib, target-restore, python3-configshell, python3-six, python3-dbus Requires: python3-gobject-base - +Patch0: regex.patch %description An administration shell for configuring iSCSI, FCoE, and other @@ -23,6 +23,7 @@ users will also need to install and use fcoe-utils. %prep %setup -q -n %{oname}-%{version} +%patch0 -p1 %build %py3_build @@ -47,6 +48,9 @@ install -m 644 systemd/* %{buildroot}%{_unitdir}/ %dir %{_sysconfdir}/target/backup %changelog +* Thu Oct 23 2025 Maurizio Lombardi - 2.1.58-4 +- Fix syntax warning RHEL-78512 + * Tue Oct 29 2024 Troy Dawson - 2.1.58-3 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018 diff --git a/tests/provision.fmf b/tests/provision.fmf deleted file mode 100644 index e660f07..0000000 --- a/tests/provision.fmf +++ /dev/null @@ -1,5 +0,0 @@ ---- - -standard-inventory-qcow2: - qemu: - m: 2G diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index f844ced..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -# Tests suitable to run in classic environment -- hosts: localhost - roles: - - role: standard-test-basic - # python-stqe cannot be installed on 'atomic', no need to run on 'container' - tags: - - classic - repositories: - - repo: "https://gitlab.com/rh-kernel-stqe/python-stqe.git" - dest: "python-stqe" - version: stable - tests: - # Install python-stqe first - # make sure we use same version of libsan - - install_stqe: - dir: python-stqe - run: pip3 install libsan==0.3.0 && python3 setup.py install --prefix= - - iscsi-initiator-utils: - dir: ./ - run: stqe-test run --fmf -f tags:targetcli_basic - required_packages: - # required for python-stqe - - python3-pyyaml - - python3-netifaces - - python3-augeas - - python3-pip