|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
import sys
|
|
|
|
|
from calculate.core.server.func import MethodsInterface
|
|
|
|
|
from calculate.lib.utils.openrc import OpenRC, OpenRCError
|
|
|
|
|
from calculate.lib.configparser import (ConfigParserLocked,
|
|
|
|
|
from calculate.lib.configparser import (ConfigParserCaseSensLocked,
|
|
|
|
|
Error as ConfigParserError)
|
|
|
|
|
import os
|
|
|
|
|
from os import path
|
|
|
|
@ -90,13 +90,13 @@ class Server(MethodsInterface):
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
cp_path = self.clVars.Get('server.cl_server_env_path')
|
|
|
|
|
cp = ConfigParserLocked(cp_path)
|
|
|
|
|
cp = ConfigParserCaseSensLocked(cp_path)
|
|
|
|
|
try:
|
|
|
|
|
with cp.lock_write() as cp:
|
|
|
|
|
if service not in cp:
|
|
|
|
|
cp.add_section(service)
|
|
|
|
|
cp[service]["dn"] = binddn
|
|
|
|
|
cp[service]["pass"] = cred
|
|
|
|
|
cp[service]["DN"] = binddn
|
|
|
|
|
cp[service]["PASS"] = cred
|
|
|
|
|
except ConfigParserError:
|
|
|
|
|
raise ServerError(_("Failed to save server parameters"))
|
|
|
|
|
return True
|
|
|
|
@ -115,7 +115,7 @@ class Server(MethodsInterface):
|
|
|
|
|
except OSError:
|
|
|
|
|
raise ServerError(_("Failed to clear server config"))
|
|
|
|
|
|
|
|
|
|
cp = ConfigParserLocked(cp_path)
|
|
|
|
|
cp = ConfigParserCaseSensLocked(cp_path)
|
|
|
|
|
try:
|
|
|
|
|
with cp.lock_write() as cp:
|
|
|
|
|
if service in cp:
|
|
|
|
|