From 2f4f8b641aeb5272d338b19b241ce8c7941c08ef Mon Sep 17 00:00:00 2001 From: Maurizio Lombardi Date: Fri, 24 Oct 2025 13:43:22 +0200 Subject: [PATCH] Fix syntax warning when running in image mode Resolves: RHEL-123591 Signed-off-by: Maurizio Lombardi --- .fmf/version | 1 + plans/sts.fmf | 4 ++++ python-configshell.spec | 7 ++++++- regex.patch | 44 +++++++++++++++++++++++++++++++++++++++++ tests/provision.fmf | 5 ----- tests/tests.yml | 27 ------------------------- 6 files changed, 55 insertions(+), 33 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/python-configshell.spec b/python-configshell.spec index a999c31..f7b0a7d 100644 --- a/python-configshell.spec +++ b/python-configshell.spec @@ -6,9 +6,10 @@ License: Apache-2.0 Summary: A framework to implement simple but nice CLIs Epoch: 1 Version: 1.1.30 -Release: 8%{?dist} +Release: 9%{?dist} URL: https://github.com/open-iscsi/configshell-fb Source: %{url}/archive/v%{version}/%{oname}-%{version}.tar.gz +Patch0: regex.patch BuildArch: noarch BuildRequires: python3-devel python3-setuptools @@ -28,6 +29,7 @@ Requires: python3-pyparsing python3-urwid %prep %setup -q -n %{oname}-%{version} +%patch0 -p1 sed -r -i "s/'pyparsing.*'/'pyparsing'/" setup.py @@ -42,6 +44,9 @@ sed -r -i "s/'pyparsing.*'/'pyparsing'/" setup.py %doc COPYING README.md %changelog +* Fri Oct 24 2025 Maurizio Lombardi - 1:1.1.30-9 +- Fix syntax warning when running in image mode (RHEL-123591) + * Tue Oct 29 2024 Troy Dawson - 1:1.1.30-8 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018 diff --git a/regex.patch b/regex.patch new file mode 100644 index 0000000..0b4b3f4 --- /dev/null +++ b/regex.patch @@ -0,0 +1,44 @@ +diff --git a/configshell/console.py b/configshell/console.py +index 8f72fa0..e73a27a 100644 +--- a/configshell/console.py ++++ b/configshell/console.py +@@ -36,7 +36,7 @@ class Console(object): + _escape = '\033[' + _ansi_format = _escape + '%dm%s' + _ansi_reset = _escape + '0m' +- _re_ansi_seq = re.compile('(\033\[..?m)') ++ _re_ansi_seq = re.compile(r'(\033\[..?m)') + + _ansi_styles = {'bold': 1, + 'underline': 4, +diff --git a/configshell/shell.py b/configshell/shell.py +index 437186d..ec7a239 100644 +--- a/configshell/shell.py ++++ b/configshell/shell.py +@@ -113,22 +113,22 @@ class ConfigShell(object): + + # Grammar of the command line + command = locatedExpr(Word(alphanums + '_'))('command') +- var = Word(alphanums + '?;&*$!#,=_\+/.<>()~@:-%[]') ++ var = Word(alphanums + r'?;&*$!#,=_\+/.<>()~@:-%[]') + value = var +- keyword = Word(alphanums + '_\-') ++ keyword = Word(alphanums + r'_\-') + kparam = locatedExpr(keyword + Suppress('=') + Optional(value, default=''))('kparams*') + pparam = locatedExpr(var)('pparams*') + parameter = kparam | pparam + parameters = OneOrMore(parameter) + bookmark = Regex('@([A-Za-z0-9:_.]|-)+') +- pathstd = Regex('([A-Za-z0-9:_.\[\]]|-)*' + '/' + '([A-Za-z0-9:_.\[\]/]|-)*') \ ++ pathstd = Regex(r'([A-Za-z0-9:_.\[\]]|-)*' + '/' + r'([A-Za-z0-9:_.\[\]/]|-)*') \ + | '..' | '.' + path = locatedExpr(bookmark | pathstd | '*')('path') + parser = Optional(path) + Optional(command) + Optional(parameters) + self._parser = parser + + if tty: +- readline.set_completer_delims('\t\n ~!#$^&(){}\|;\'",?') ++ readline.set_completer_delims('\t\n ~!#$^&(){}|;\'",?') + readline.set_completion_display_matches_hook( + self._display_completions) + 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