diff --git a/ipaclient/remote_plugins/__init__.py b/ipaclient/remote_plugins/__init__.py index a4901335a..dff445b33 100644 --- a/ipaclient/remote_plugins/__init__.py +++ b/ipaclient/remote_plugins/__init__.py @@ -41,7 +41,7 @@ class ServerInfo(MutableMapping): try: self._language = locale.setlocale( locale.LC_MESSAGES, '' - ).split('.')[0].lower() + ).split('.', maxsplit=1)[0].lower() except locale.Error: self._language = 'en_us' diff --git a/ipalib/rpc.py b/ipalib/rpc.py index 65ee0a317..431436f60 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -533,7 +533,7 @@ class LanguageAwareTransport(MultiProtocolTransport): try: lang = locale.setlocale( locale.LC_MESSAGES, '' - ).split('.')[0].lower() + ).split('.', maxsplit=1)[0].lower() except locale.Error: # fallback to default locale lang = 'en_us' diff --git a/ipasetup.py.in b/ipasetup.py.in index 30c8c44b0..e1cb64bb7 100644 --- a/ipasetup.py.in +++ b/ipasetup.py.in @@ -63,12 +63,6 @@ VERSION = '@VERSION@' SETUPTOOLS_VERSION = tuple(int(v) for v in setuptools.__version__.split(".")) -# backwards compatibility with setuptools 0.9.8, split off +gitHASH suffix -# PEP 440 was introduced in setuptools 8. -if SETUPTOOLS_VERSION < (8, 0, 0): - VERSION = VERSION.split('+')[0] - - PACKAGE_VERSION = { 'cryptography': 'cryptography >= 1.6', 'custodia': 'custodia >= 0.3.1', diff --git a/ipatests/test_integration/test_winsyncmigrate.py b/ipatests/test_integration/test_winsyncmigrate.py index 87fb9a58f..7f82891e3 100644 --- a/ipatests/test_integration/test_winsyncmigrate.py +++ b/ipatests/test_integration/test_winsyncmigrate.py @@ -59,7 +59,9 @@ class TestWinsyncMigrate(IntegrationTest): ipa_group = 'ipa_group' ad_user = 'testuser' default_shell = platformconstants.DEFAULT_SHELL - selinuxuser = platformconstants.SELINUX_USERMAP_ORDER.split("$")[0] + selinuxuser = platformconstants.SELINUX_USERMAP_ORDER.split( + "$", maxsplit=1 + )[0] test_role = 'test_role' test_hbac_rule = 'test_hbac_rule' test_selinux_map = 'test_selinux_map' diff --git a/ipatests/test_webui/data_selinuxusermap.py b/ipatests/test_webui/data_selinuxusermap.py index 312e7592f..1079b8a4c 100644 --- a/ipatests/test_webui/data_selinuxusermap.py +++ b/ipatests/test_webui/data_selinuxusermap.py @@ -5,8 +5,9 @@ from ipaplatform.constants import constants as platformconstants # for example, user_u:s0 -selinuxuser1 = platformconstants.SELINUX_USERMAP_ORDER.split("$")[0] -selinuxuser2 = platformconstants.SELINUX_USERMAP_ORDER.split("$")[1] +selunux_users = platformconstants.SELINUX_USERMAP_ORDER.split("$") +selinuxuser1 = selunux_users[0] +selinuxuser2 = selunux_users[1] selinux_mcs_max = platformconstants.SELINUX_MCS_MAX selinux_mls_max = platformconstants.SELINUX_MLS_MAX diff --git a/ipatests/test_xmlrpc/test_cert_plugin.py b/ipatests/test_xmlrpc/test_cert_plugin.py index a18928f3c..433cebcd7 100644 --- a/ipatests/test_xmlrpc/test_cert_plugin.py +++ b/ipatests/test_xmlrpc/test_cert_plugin.py @@ -281,7 +281,7 @@ class test_cert_find(XMLRPC_test): is_db_configured() - short = api.env.host.split('.')[0] + short = api.env.host.split('.', maxsplit=1)[0] def test_0001_find_all(self): """ diff --git a/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py b/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py index 662212a63..834ee5930 100644 --- a/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py +++ b/ipatests/test_xmlrpc/test_selinuxusermap_plugin.py @@ -33,8 +33,9 @@ from ipatests.test_xmlrpc.test_user_plugin import get_user_result import pytest rule1 = u'selinuxrule1' -selinuxuser1 = platformconstants.SELINUX_USERMAP_ORDER.split("$")[0] -selinuxuser2 = platformconstants.SELINUX_USERMAP_ORDER.split("$")[1] +selinux_users = platformconstants.SELINUX_USERMAP_ORDER.split("$") +selinuxuser1 = selinux_users[0] +selinuxuser2 = selinux_users[1] INVALID_MCS = "Invalid MCS value, must match {}, where max category {}".format( platformconstants.SELINUX_MCS_REGEX,