mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-13 17:02:02 -05:00
ipachangeconf: Add ability to preserve section case
The IPAChangeConf normallizes section names to lower case. There are cases where this behaviour might not be desirable, so provide a way to opt out. https://fedorahosted.org/freeipa/ticket/5069 Reviewed-By: Gabe Alford <redhatrises@gmail.com>
This commit is contained in:
1 parent
b543c9a137
commit
304c8694c4
1 file changed
+4
-1
@@ -63,6 +63,7 @@ class IPAChangeConf:
|
||||
self.deol = self.eol[0]
|
||||
self.sectnamdel = ("[", "]")
|
||||
self.subsectdel = ("{", "}")
|
||||
self.case_insensitive_sections = True
|
||||
|
||||
def setProgName(self, name):
|
||||
self.progname = name
|
||||
@@ -114,7 +115,9 @@ class IPAChangeConf:
|
||||
return False
|
||||
|
||||
def matchSection(self, line):
|
||||
cl = "".join(line.strip().split()).lower()
|
||||
cl = "".join(line.strip().split())
|
||||
cl = cl.lower() if self.case_insensitive_sections else cl
|
||||
|
||||
if len(self.sectnamdel) != 2:
|
||||
return False
|
||||
if not cl.startswith(self.sectnamdel[0]):
|
||||
|
||||
Reference in new issue
Block a user