From 07c668e37fbdb34c58b4a196cd3a770590be0f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Wed, 2 Jun 2010 11:57:30 +0400 Subject: [PATCH 1/2] Bugfix --- pym/cl_client.py | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pym/cl_client.py b/pym/cl_client.py index e0e1dda..24799db 100644 --- a/pym/cl_client.py +++ b/pym/cl_client.py @@ -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__]) @@ -266,7 +266,7 @@ class client(share): # Файлы котороые не удаляются при очистке домашней директории skipHomeFile = ["Home","Disks","FTP",logOutFile,configFileDesktop] - # словарь опций сервисов из /var/calculate/remote/calculate.env + # словарь опций сервисов из /var/calculate/remote/server.env optionsInfo = {} @@ -303,8 +303,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 @@ -365,7 +365,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 @@ -379,7 +379,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 @@ -897,7 +897,7 @@ class client(share): flagError = True break #Проверяем на монтирование директории - if os.path.ismount(path): + if isMount(path): continue # Имя хоста для монтирования ресурса hostConnect = defaultHost @@ -1085,7 +1085,7 @@ class client(share): flagError = True break # Проверяем на монтирование директории - if os.path.ismount(path): + if isMount(path): continue # Имя хоста для монтирования ресурса hostConnect = defaultHost @@ -1387,7 +1387,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 @@ -1396,7 +1396,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 @@ -1483,8 +1483,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")) @@ -1609,8 +1609,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" + " ...") @@ -1739,6 +1739,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 и домашней директории если компьютер в домене @@ -1749,8 +1753,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") + else: self.printWARNING(_("This computer is not in domain")) # Если шаблоны не актуальны накладываем новую версию шаблонов From 98c2153a840aa36330363f9af31d36b01e6e9cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BC=D0=BE=D1=83=D0=BA=D0=B8=D0=BD=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?= Date: Wed, 2 Jun 2010 12:02:36 +0400 Subject: [PATCH 2/2] Bugfix --- pym/cl_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pym/cl_client.py b/pym/cl_client.py index 24799db..d98cab5 100644 --- a/pym/cl_client.py +++ b/pym/cl_client.py @@ -1754,7 +1754,7 @@ class client(share): domain = self.clVars.Get("cl_remote_host") if domain: foundMountRemote = isMount("/var/calculate/remote") - + foundMountHome = self.isMountDomainHome() else: self.printWARNING(_("This computer is not in domain")) # Если шаблоны не актуальны накладываем новую версию шаблонов