From a8dd0709927eae044f789bcd02bc75a9ae7258b5 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Fri, 2 Dec 2022 18:27:36 +0300 Subject: [PATCH] pylint: Replace deprecated pipes `pipes` module is deprecated as of Python 3.11. https://docs.python.org/3/library/pipes.html#module-pipes: > Deprecated since version 3.11, will be removed in version 3.13: The pipes module is deprecated (see PEP 594 for details). IPA code used only `quote` function from `pipes` that in turn is the alias for `shlex.quote` since Python 3.3: https://github.com/python/cpython/commit/9bce311ea4f58ec04cab356a748e173ecfea381c Fixes: https://pagure.io/freeipa/issue/9278 Signed-off-by: Stanislav Levin Reviewed-By: Stanislav Levin --- ipaserver/install/httpinstance.py | 3 +-- ipatests/pytest_ipa/integration/tasks.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py index 8bd690880..cc21f9f03 100644 --- a/ipaserver/install/httpinstance.py +++ b/ipaserver/install/httpinstance.py @@ -25,7 +25,6 @@ import os import glob import errno import shlex -import pipes # pylint: disable=deprecated-module import shutil import tempfile @@ -320,7 +319,7 @@ class HTTPInstance(service.Service): if args[0] != paths.IPA_SERVER_GUARD: self.backup_state('certmonger_ipa_helper', helper) args = [paths.IPA_SERVER_GUARD] + args - helper = ' '.join(pipes.quote(a) for a in args) + helper = ' '.join(shlex.quote(a) for a in args) ca_iface.Set('org.fedorahosted.certmonger.ca', 'external-helper', helper) finally: diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py index 10ed12040..76bf34a3f 100755 --- a/ipatests/pytest_ipa/integration/tasks.py +++ b/ipatests/pytest_ipa/integration/tasks.py @@ -33,7 +33,7 @@ import copy import subprocess import tempfile import time -from pipes import quote # pylint: disable=deprecated-module +from shlex import quote import configparser from contextlib import contextmanager from pkg_resources import parse_version