Skip to content

Commit

Permalink
pylint: Fix redundant-u-string-prefix
Browse files Browse the repository at this point in the history
Pylint 2.10 introduced new checker `redundant-u-string-prefix`:
> Added redundant-u-string-prefix checker: Emitted when the u prefix is
  added to a string

https://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-10-0
pylint-dev/pylint#4102

Fixes: freeipa#244
Signed-off-by: Stanislav Levin <slev@altlinux.org>
  • Loading branch information
stanislavlevin committed Feb 15, 2022
1 parent 9c6c009 commit 666d654
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 59 deletions.
8 changes: 4 additions & 4 deletions src/ipahealthcheck/ipa/plugin.py
Expand Up @@ -73,11 +73,11 @@ def initialize(self, framework, config, options=None):
return

roles = (
ADtrustBasedRole(u"ad_trust_agent_server",
u"AD trust agent"),
ADtrustBasedRole("ad_trust_agent_server",
"AD trust agent"),
ServiceBasedRole(
u"ad_trust_controller_server",
u"AD trust controller",
"ad_trust_controller_server",
"AD trust controller",
component_services=['ADTRUST']
),
)
Expand Down
4 changes: 2 additions & 2 deletions src/ipahealthcheck/ipa/topology.py
Expand Up @@ -72,8 +72,8 @@ def run_check(self, suffix):
@duration
def check(self):

for y in self.run_check(u'domain'):
for y in self.run_check('domain'):
yield y
if api.Command.ca_is_enabled()['result']:
for y in self.run_check(u'ca'):
for y in self.run_check('ca'):
yield y
2 changes: 1 addition & 1 deletion tests/test_dogtag_connectivity.py
Expand Up @@ -22,7 +22,7 @@ def test_ca_connection_ok(self):
"""CA connectivity check when cert_show returns a valid value"""
m_api.Command.cert_show.side_effect = None
m_api.Command.cert_show.return_value = {
u'result': {u'revoked': False}
'result': {'revoked': False}
}

framework = object()
Expand Down
18 changes: 9 additions & 9 deletions tests/test_ipa_revocation.py
Expand Up @@ -40,13 +40,13 @@ class TestRevocation(BaseTest):
def test_revocation_ok(self):
m_api.Command.cert_show.side_effect = [
{
u'result': {
u"revoked": False,
'result': {
"revoked": False,
}
},
{
u'result': {
u"revoked": False,
'result': {
"revoked": False,
}
},
]
Expand All @@ -69,14 +69,14 @@ def test_revocation_ok(self):
def test_revocation_one_bad(self):
m_api.Command.cert_show.side_effect = [
{
u'result': {
u"revoked": False,
'result': {
"revoked": False,
}
},
{
u'result': {
u"revoked": True,
u"revocation_reason": 4,
'result': {
"revoked": True,
"revocation_reason": 4,
}
},
]
Expand Down
78 changes: 39 additions & 39 deletions tests/test_ipa_topology.py
Expand Up @@ -15,13 +15,13 @@ class TestTopology(BaseTest):
def test_topology_ok(self):
m_api.Command.topologysuffix_verify.side_effect = [
{
u'result': {
u"in_order": True,
'result': {
"in_order": True,
}
},
{
u'result': {
u"in_order": True,
'result': {
"in_order": True,
}
},
]
Expand All @@ -43,27 +43,27 @@ def test_topology_ok(self):
def test_topology_domain_bad(self):
m_api.Command.topologysuffix_verify.side_effect = [
{
u'result': {
u"connect_errors": [
'result': {
"connect_errors": [
[
u"ipa.example.test",
[u"ipa.example.test"],
[u"replica2.example.test"]
"ipa.example.test",
["ipa.example.test"],
["replica2.example.test"]
],
[
u"replica2.example.test",
[u"replica2.example.test"],
[u"ipa.example.test"]
"replica2.example.test",
["replica2.example.test"],
["ipa.example.test"]
]
],
u"in_order": False,
u"max_agmts": 4,
u"max_agmts_errors": []
"in_order": False,
"max_agmts": 4,
"max_agmts_errors": []
}
},
{
u'result': {
u"in_order": True,
'result': {
"in_order": True,
}
},
]
Expand Down Expand Up @@ -106,27 +106,27 @@ def test_topology_domain_bad(self):
def test_topology_ca_bad(self):
m_api.Command.topologysuffix_verify.side_effect = [
{
u'result': {
u"in_order": True,
'result': {
"in_order": True,
}
},
{
u'result': {
u"connect_errors": [
'result': {
"connect_errors": [
[
u"ipa.example.test",
[u"ipa.example.test"],
[u"replica2.example.test"]
"ipa.example.test",
["ipa.example.test"],
["replica2.example.test"]
],
[
u"replica2.example.test",
[u"replica2.example.test"],
[u"ipa.example.test"]
"replica2.example.test",
["replica2.example.test"],
["ipa.example.test"]
]
],
u"in_order": False,
u"max_agmts": 4,
u"max_agmts_errors": []
"in_order": False,
"max_agmts": 4,
"max_agmts_errors": []
}
},
]
Expand Down Expand Up @@ -169,21 +169,21 @@ def test_topology_ca_bad(self):
def test_topology_domain_max_agmts(self):
m_api.Command.topologysuffix_verify.side_effect = [
{
u'result': {
u"connect_errors": [],
u"in_order": False,
u"max_agmts": 1,
u"max_agmts_errors": [
'result': {
"connect_errors": [],
"in_order": False,
"max_agmts": 1,
"max_agmts_errors": [
[
u"ipa.example.test",
[u"replica2.example.test"],
"ipa.example.test",
["replica2.example.test"],
],
],
}
},
{
u'result': {
u"in_order": True,
'result': {
"in_order": True,
}
},
]
Expand Down
8 changes: 4 additions & 4 deletions tests/util.py
Expand Up @@ -112,9 +112,9 @@ def __init__(self, attr_name=None, name=None):
m_api.env = Mock()
m_api.env.host = 'server.ipa.example'
m_api.env.server = 'server.ipa.example'
m_api.env.realm = u'IPA.EXAMPLE'
m_api.env.domain = u'ipa.example'
m_api.env.basedn = u'dc=ipa,dc=example'
m_api.env.realm = 'IPA.EXAMPLE'
m_api.env.domain = 'ipa.example'
m_api.env.basedn = 'dc=ipa,dc=example'
m_api.env.container_user = DN(('cn', 'users'), ('cn', 'accounts'))
m_api.env.container_group = DN(('cn', 'groups'), ('cn', 'accounts'))
m_api.env.container_host = DN(('cn', 'computers'), ('cn', 'accounts'))
Expand All @@ -124,7 +124,7 @@ def __init__(self, attr_name=None, name=None):
m_api.Backend = Mock()
m_api.Command = Mock()
m_api.Command.ping.return_value = {
u'summary': u'IPA server version 4.4.3. API version 2.215',
'summary': 'IPA server version 4.4.3. API version 2.215',
}


Expand Down

0 comments on commit 666d654

Please sign in to comment.