В cl-client добавлена опция '--uninstall' - наложение профиля клиента по умолчанию и при необходимости отключение от домена

git-svn-id: http://svn.calculate.ru/calculate2/calculate-client/trunk@1459 c91db197-33c1-4113-bf15-f8a5c547ca64
develop
asamoukin 15 years ago
parent fa34a333c7
commit 51fe7613c6

@ -349,7 +349,14 @@ WHEN may be 'never', 'always', or 'auto'")
{'progAccess':(0,),
'longOption':"install",
'helpChapter':_("Common options"),
'help':_("Adds use of scripts this package for window manager")
'help':_("Adds use of scripts this package for window manager and, \
if necessary, connects to domain")
},
{'progAccess':(0,),
'longOption':"uninstall",
'helpChapter':_("Common options"),
'help':_("Remove use of scripts this package for window manager and, \
if necessary, disconnects domain")
},
{'progAccess':(0,),
'longOption':"mount",
@ -959,6 +966,8 @@ conjunction with the 'login' or 'logout'")
self.clVars.Delete("cl_remote_pw","local")
self.clVars.Set("cl_remote_host","",True)
self.clVars.Set("cl_remote_pw","",True)
# Изменяем базовую директорию наложения профилей
clVars.Set("cl_root_path","/",True)
# Наложим профили install/domain
# Новые пути к профилям
profPaths=['/usr/lib/calculate/calculate-client/profile/install/domain',
@ -984,7 +993,43 @@ conjunction with the 'login' or 'logout'")
profpath.append(profPath)
return profpath
def applyProfilesClient(self, clVars=False, printSuccess=True,
def uninstallClient(self):
"""Наложение профиля клиента по умолчанию и
при необходимости отключение от домена"""
if not self.isRoot():
return False
self.createClVars()
clVars = self.clVars
messageOk = _("Removed use of scripts this package for window \
manager") + " ..."
# Устанавливаем переменную профиля
clVars.Set("cl_pass_step","uninstall",True)
remoteHost = clVars.Get("cl_remote_host")
if remoteHost:
if not self.delDomain():
return False
if printSuccess:
self.printOK(messageOk)
return True
# Изменяем базовую директорию наложения профилей
clVars.Set("cl_root_path","/",True)
# Новые пути к профилям
profPaths=['/usr/lib/calculate/calculate-client/profile/install/client',
'/var/calculate/remote/client-profile/install/client',
'/var/calculate/client-profile/install/client']
# Изменяем переменную хранения профилей
clVars.Set("cl_profile_path",profPaths,True)
# Наложим профили
dirsAndFiles = self.applyProfilesFromSystem()
if not dirsAndFiles:
self.printERROR(_("Not apply 'install/client' profiles"))
return False
if printSuccess:
self.printOK(messageOk)
return True
def installClient(self, clVars=False, printSuccess=True,
addDomain=True):
"""Наложение профиля клиента и при необходимости подключение к домену"""
if not self.isRoot():
@ -1123,7 +1168,7 @@ manager") + " ..."
or ld_bind_dn or ld_bind_pw")
return False
# Наложим профили install/client
if not self.applyProfilesClient(self.clVars, False, False):
if not self.installClient(self.clVars, False, False):
return False
# Наложим профили install/domain
# Новые пути к профилям

Loading…
Cancel
Save