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 <slev@altlinux.org>
Reviewed-By: Stanislav Levin <slev@altlinux.org>
This commit is contained in:
Stanislav Levin authored and Florence Blanc-Renaud committed 2023-01-10 08:30:58 +01:00
1 parent 4352bd5a50
commit a8dd070992
2 files changed
+2 -3

No files matched your search

+1 -2
View File
@@ -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:
+1 -1
View File
@@ -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