Изменен способ определения доменной машины

3.3.0_alpha2
Mike Khiretskiy 9 years ago
parent 277fa3d408
commit a01e498241

@ -31,7 +31,7 @@ from os import path
from datavars import DataVarsClient, DataVars, __version__,__app__
from calculate.lib.cl_template import (Template, iniParser, TemplatesError,
ProgressTemplate)
ProgressTemplate, SystemIni)
from calculate.lib.cl_print import color_print
from calculate.lib.cl_ldap import ldapUser
from calculate.lib.utils.ip import Pinger, isOpenPort, IPError
@ -251,12 +251,10 @@ class Client(commandServer, encrypt, Desktop):
"""
self.clVars.Delete("cl_remote_host", "local")
self.clVars.Delete("cl_remote_pw", "local")
self.clVars.Delete("os_remote_auth")
self.clVars.Delete("os_remote_client")
SystemIni.delVar('client','connect')
self.clVars.Set("cl_remote_host", "", True)
self.clVars.Set("cl_remote_pw", "", True)
self.clVars.Set("os_remote_auth", "", True)
self.clVars.Set("os_remote_client", "", True)
return True
def mountSambaRes(self,host,userName,userPwd,res,rpath,uid=None,gid=None):
@ -1078,12 +1076,11 @@ class Client(commandServer, encrypt, Desktop):
def writeClientVars(self,domain,currentVersion,pwdRemote):
"""
Записать переменные переменные клиента
Записать переменные клиента
"""
# write domain to config
self.clVars.Write("os_remote_auth", domain, True)
SystemIni.setVar('client',{'connect':domain})
# write current program version
self.clVars.Write("os_remote_client", currentVersion, True)
self.clVars.Write("cl_remote_host", domain, True, "local")
self.clVars.Write("cl_remote_pw", pwdRemote, True, "local")
return True
@ -1126,13 +1123,11 @@ class Client(commandServer, encrypt, Desktop):
self.printSUCCESS(_("The workstation is configured for work "
"in the domain"))
currentVersion = self.clVars.Get("cl_ver")
self.clVars.Write("os_remote_client", currentVersion, True)
self.clVars.Write("os_remote_auth", hostAuth, True)
SystemIni.setVar('client',{'connect':hostAuth})
else:
self.printSUCCESS(_("The workstation is configured for work "
"outside the domain"))
self.clVars.Delete("os_remote_auth")
self.clVars.Delete("os_remote_client")
SystemIni.delVar('client','connect')
return True
def cDelLdapSysUsersAndSyncCache(self):

@ -20,7 +20,7 @@ from os import path
import re
from calculate.lib.datavars import (Variable,VariableError,ReadonlyVariable,
ReadonlyTableVariable,FieldValue)
from calculate.lib.cl_template import iniParser
from calculate.lib.cl_template import iniParser, SystemIni
from calculate.lib.utils.files import readLinesFile,isMount,readFile, find
from calculate.lib.utils.common import getValueFromCmdLine,cmpVersion
from calculate.lib.variables.user import VariableUrLogin
@ -79,6 +79,8 @@ class VariableOsRemoteAuth(Variable):
"""
Client work mode (local or hostname)
"""
def get(self):
return SystemIni().getVar('client','connect')
class VariableOsRemoteClient(Variable):
@ -299,11 +301,6 @@ class VariableClClientRelevanceSet(ReadonlyVariable):
if (self.Get('cl_remote_host') and
not isMount(self.Get('cl_client_remote_path'))):
return "off"
currentVersion = self.Get("cl_ver")
# версия программы, который были наложены шаблоны
previousVersion = self.Get("os_remote_client")
if cmpVersion(currentVersion,previousVersion):
return "off"
return "on"
class VariableClClientRemotePath(Variable):

Loading…
Cancel
Save