Merge branch 'master' of git.calculate.ru:calculate-client

master3.3
Mike Hiretsky 14 years ago
commit f65c473386

@ -35,7 +35,7 @@ from cl_datavars import DataVars
from cl_print import color_print from cl_print import color_print
from cl_ldap import ldapUser from cl_ldap import ldapUser
from client.progressbar import ProgressBar from client.progressbar import ProgressBar
from cl_utils import runOsCommand, getpathenv, getModeFile, removeDir from cl_utils import runOsCommand, getpathenv, getModeFile, removeDir, isMount
from _cl_keys import getKey, clearKey from _cl_keys import getKey, clearKey
lang().setLanguage(sys.modules[__name__]) lang().setLanguage(sys.modules[__name__])
@ -260,7 +260,7 @@ class client(share):
# Файлы котороые не удаляются при очистке домашней директории # Файлы котороые не удаляются при очистке домашней директории
skipHomeFile = ["Home","Disks","FTP",logOutFile,configFileDesktop] skipHomeFile = ["Home","Disks","FTP",logOutFile,configFileDesktop]
# словарь опций сервисов из /var/calculate/remote/calculate.env # словарь опций сервисов из /var/calculate/remote/server.env
optionsInfo = {} optionsInfo = {}
@ -297,8 +297,8 @@ class client(share):
def isDomain(self): def isDomain(self):
"""Находится ли компьютер в домене""" """Находится ли компьютер в домене"""
foundMountRemote = os.path.ismount("/var/calculate/remote") foundMountRemote = isMount("/var/calculate/remote")
foundMountHome = os.path.ismount("/home") foundMountHome = self.isMountDomainHome()
remoteHost = self.clVars.Get("cl_remote_host") remoteHost = self.clVars.Get("cl_remote_host")
if remoteHost and foundMountRemote and foundMountHome: if remoteHost and foundMountRemote and foundMountHome:
return True return True
@ -359,7 +359,7 @@ class client(share):
textLine = self.mountSambaRes(host,userName,userPwd,uid,gid,res,path) textLine = self.mountSambaRes(host,userName,userPwd,uid,gid,res,path)
if not (textLine is None): if not (textLine is None):
# Проверяем на монтирование директории # Проверяем на монтирование директории
if os.path.ismount(path): if isMount(path):
textLineUmount = self.umountSleepPath(path) textLineUmount = self.umountSleepPath(path)
if not textLineUmount: if not textLineUmount:
return False return False
@ -373,7 +373,7 @@ class client(share):
gid,res,path) gid,res,path)
if not (textLine is None): if not (textLine is None):
# Проверяем на монтирование директории # Проверяем на монтирование директории
if os.path.ismount(path): if isMount(path):
textLineUmount = self.umountSleepPath(path) textLineUmount = self.umountSleepPath(path)
if not textLineUmount: if not textLineUmount:
return False return False
@ -891,7 +891,7 @@ class client(share):
flagError = True flagError = True
break break
#Проверяем на монтирование директории #Проверяем на монтирование директории
if os.path.ismount(path): if isMount(path):
continue continue
# Имя хоста для монтирования ресурса # Имя хоста для монтирования ресурса
hostConnect = defaultHost hostConnect = defaultHost
@ -1079,7 +1079,7 @@ class client(share):
flagError = True flagError = True
break break
# Проверяем на монтирование директории # Проверяем на монтирование директории
if os.path.ismount(path): if isMount(path):
continue continue
# Имя хоста для монтирования ресурса # Имя хоста для монтирования ресурса
hostConnect = defaultHost hostConnect = defaultHost
@ -1381,7 +1381,7 @@ class client(share):
# Задержки при отмонтированиии директории # Задержки при отмонтированиии директории
sleeps = [0.5, 2, 5] sleeps = [0.5, 2, 5]
# Проверяем на монтирование директорию # Проверяем на монтирование директорию
if os.path.ismount(path): if isMount(path):
textLine = self.execProg("umount %s"%path) textLine = self.execProg("umount %s"%path)
if textLine is False: if textLine is False:
i = 0 i = 0
@ -1390,7 +1390,7 @@ class client(share):
# Задержка перед следующей попыткой # Задержка перед следующей попыткой
time.sleep(sleeps[i]) time.sleep(sleeps[i])
# Отмонтируем Samba ресурс # Отмонтируем Samba ресурс
if os.path.ismount(path): if isMount(path):
textLine = self.execProg("umount %s"%path) textLine = self.execProg("umount %s"%path)
else: else:
textLine = None textLine = None
@ -1477,8 +1477,8 @@ class client(share):
return False return False
pathRemote = "/var/calculate/remote" pathRemote = "/var/calculate/remote"
pathHome = "/home" pathHome = "/home"
foundMountRemote = os.path.ismount(pathRemote) foundMountRemote = isMount(pathRemote)
foundMountHome = os.path.ismount(pathHome) foundMountHome = isMount(pathHome)
domain = self.clVars.Get("cl_remote_host") domain = self.clVars.Get("cl_remote_host")
if not domain: if not domain:
self.printWARNING(_("The computer is not in domain")) self.printWARNING(_("The computer is not in domain"))
@ -1603,8 +1603,8 @@ class client(share):
elif self.clVars.Get("cl_remote_host") and \ elif self.clVars.Get("cl_remote_host") and \
self.clVars.Get("cl_remote_host") == domain: self.clVars.Get("cl_remote_host") == domain:
pwd = self.clVars.Get("cl_remote_pw") pwd = self.clVars.Get("cl_remote_pw")
foundMountRemote = os.path.ismount("/var/calculate/remote") foundMountRemote = isMount("/var/calculate/remote")
foundMountHome = os.path.ismount("/home") foundMountHome = self.isMountDomainHome()
if foundMountRemote: if foundMountRemote:
self.printWARNING(_("Samba resource [%s] is mount")%\ self.printWARNING(_("Samba resource [%s] is mount")%\
"remote" + " ...") "remote" + " ...")
@ -1733,6 +1733,10 @@ class client(share):
self.clVars.Delete("os_remote_client") self.clVars.Delete("os_remote_client")
return True return True
def isMountDomainHome(self):
"""Примонтирована ли директория /home для ввода в домен"""
return isMount("/home") == "/var/calculate/client-home"
def mountRemote(self): def mountRemote(self):
"""Монтирование remote и домашней директории если компьютер в домене """Монтирование remote и домашней директории если компьютер в домене
@ -1743,8 +1747,8 @@ class client(share):
return False return False
domain = self.clVars.Get("cl_remote_host") domain = self.clVars.Get("cl_remote_host")
if domain: if domain:
foundMountRemote = os.path.ismount("/var/calculate/remote") foundMountRemote = isMount("/var/calculate/remote")
foundMountHome = os.path.ismount("/home") foundMountHome = self.isMountDomainHome()
else: else:
self.printWARNING(_("This computer is not in domain")) self.printWARNING(_("This computer is not in domain"))
# Если шаблоны не актуальны накладываем новую версию шаблонов # Если шаблоны не актуальны накладываем новую версию шаблонов

Loading…
Cancel
Save