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