Removes several pylint warnings.

This patche removes 93 pylint deprecation warnings due to invalid escape
sequences (mostly 'invalid escape sequence \d') on unicode strings.

Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Rafael Guterres Jeffman
2019-09-23 18:30:22 -03:00
committed by Christian Heimes
parent bc53544c6f
commit c898be1df9
32 changed files with 84 additions and 77 deletions

View File

@@ -675,7 +675,8 @@ class ADTRUSTInstance(service.Service):
has_dns_lookup_kdc_true = False
for line in krb5conf:
if re.match("^\s*dns_lookup_kdc\s*=\s*[Tt][Rr][Uu][Ee]\s*$", line):
regex = r"^\s*dns_lookup_kdc\s*=\s*[Tt][Rr][Uu][Ee]\s*$"
if re.match(regex, line):
has_dns_lookup_kdc_true = True
break
krb5conf.close()

View File

@@ -67,8 +67,8 @@ if six.PY3:
logger = logging.getLogger(__name__)
named_conf_section_ipa_start_re = re.compile('\s*dyndb\s+"ipa"\s+"[^"]+"\s+{')
named_conf_section_options_start_re = re.compile('\s*options\s+{')
named_conf_section_ipa_start_re = re.compile(r'\s*dyndb\s+"ipa"\s+"[^"]+"\s+{')
named_conf_section_options_start_re = re.compile(r'\s*options\s+{')
named_conf_section_end_re = re.compile('};')
named_conf_arg_ipa_re = re.compile(
r'(?P<indent>\s*)(?P<name>\S+)\s"(?P<value>[^"]+)";')

View File

@@ -463,7 +463,7 @@ class DsInstance(service.Service):
('cn', 'config')),
objectclass=["top", "nsSaslMapping"],
cn=["Full Principal"],
nsSaslMapRegexString=['\(.*\)@\(.*\)'],
nsSaslMapRegexString=[r'\(.*\)@\(.*\)'],
nsSaslMapBaseDNTemplate=[self.suffix],
nsSaslMapFilterTemplate=['(krbPrincipalName=\\1@\\2)'],
nsSaslMapPriority=['10'],

View File

@@ -140,7 +140,7 @@ def find_autoredirect(fqdn):
"""
filename = paths.HTTPD_IPA_REWRITE_CONF
if os.path.exists(filename):
pattern = "^RewriteRule \^/\$ https://%s/ipa/ui \[L,NC,R=301\]" % fqdn
pattern = r"^RewriteRule \^/\$ https://%s/ipa/ui \[L,NC,R=301\]" % fqdn
p = re.compile(pattern)
for line in fileinput.input(filename):
if p.search(line):
@@ -157,7 +157,7 @@ def find_version(filename):
If the file does not exist, returns -1.
"""
if os.path.exists(filename):
pattern = "^[\s#]*VERSION\s+([0-9]+)\s+.*"
pattern = r"^[\s#]*VERSION\s+([0-9]+)\s+.*"
p = re.compile(pattern)
for line in fileinput.input(filename):
if p.search(line):