From 7a21158009f9b3d40038ff7c556001012de65656 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, 11 Aug 2010 18:04:53 +0000 Subject: [PATCH] A modified algorithm connect to a domain --- pym/cl_client.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/pym/cl_client.py b/pym/cl_client.py index 9ab177d..2ff3d7d 100644 --- a/pym/cl_client.py +++ b/pym/cl_client.py @@ -1535,9 +1535,6 @@ class client(share, commandServer, encrypt): foundMountRemote = isMount(pathRemote) foundMountHome = isMount(pathHome) domain = self.clVars.Get("cl_remote_host") - if not domain: - self.printWARNING(_("The computer is not in domain")) - return True if foundMountRemote: textLineUmount = self.umountSleepPath(pathRemote) if not textLineUmount: @@ -1546,6 +1543,9 @@ class client(share, commandServer, encrypt): textLineUmount = self.umountSleepPath(pathHome) if not textLineUmount: return False + if not domain: + self.printWARNING(_("The computer is not in domain")) + return True # Удаляем переменные из env файлов self.removeVars() # Устанавливаем действие выход из домена @@ -1558,7 +1558,6 @@ class client(share, commandServer, encrypt): self.printSUCCESS(_("Apply undomain templates")) if not self.delDaemonAutostart("client"): return False - # Записываем действие, введен в домен self.printOK(_("Computer removed from domain %s")%domain + " ...") return True @@ -1663,24 +1662,23 @@ class client(share, commandServer, encrypt): if not foudHostSamba: self.printERROR(_("Not found Samba server in %s")%domain) return False - pwd = False - if self.clVars.Get("cl_remote_host") and \ - self.clVars.Get("cl_remote_host") != domain: - if not self.delDomain(): - return False - elif self.clVars.Get("cl_remote_host") and \ - self.clVars.Get("cl_remote_host") == domain: - pwd = self.clVars.Get("cl_remote_pw") + remoteHost = self.clVars.Get("cl_remote_host") + if remoteHost: + self.printERROR(_("The computer is already in the domain %s")\ + %remoteHost) + self.printWARNING(_("Before joining the domain, \ +you need to remove it from the previous domain")) + self.printWARNING(_("Run 'cl-client -t'")) + return False + foundMountRemote = isMount("/var/calculate/remote") foundMountHome = self.isMountDomainHome() if foundMountRemote: - self.printWARNING(_("Samba resource [%s] is mount")%\ + self.printERROR(_("Samba resource [%s] is mount")%\ "remote" + " ...") + return False else: - if pwd: - userPwd = pwd - else: - userPwd=self.getUserPassword(\ + userPwd=self.getUserPassword(\ _("Domain password for the desktop")) pathRemote = "/var/calculate/remote" pwdRemote = userPwd