|
|
@ -1317,16 +1317,28 @@ class Client(commandServer, encrypt, Desktop):
|
|
|
|
|
|
|
|
|
|
|
|
def syncLoginProfileNew(self, host, username, pwd,
|
|
|
|
def syncLoginProfileNew(self, host, username, pwd,
|
|
|
|
uid, gid, homeDir,
|
|
|
|
uid, gid, homeDir,
|
|
|
|
profileName, clearHomeDir=True):
|
|
|
|
profileName, replHost=False,
|
|
|
|
|
|
|
|
clearHomeDir=True):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Получить профиль пользователя из домена
|
|
|
|
Получить профиль пользователя из домена
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
ps = self.get_syncer(host, username, pwd)
|
|
|
|
ps = self.get_syncer(host, username, pwd)
|
|
|
|
# if currect server has any files then sync it
|
|
|
|
# if currect server has any files then sync it
|
|
|
|
remoteProfile = "::profile/{}".format(profileName)
|
|
|
|
remoteProfile = "::profile/{}".format(profileName)
|
|
|
|
|
|
|
|
if replHost:
|
|
|
|
|
|
|
|
remoteOpts = ("-c", "--zc=zstd")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
remoteOpts = ()
|
|
|
|
if not self.syncUserNew(ps, uid, gid, homeDir, "login",
|
|
|
|
if not self.syncUserNew(ps, uid, gid, homeDir, "login",
|
|
|
|
remoteProfile, host=host):
|
|
|
|
remoteProfile, host=host,
|
|
|
|
|
|
|
|
rsyncopts=remoteOpts):
|
|
|
|
error_output = ps.output
|
|
|
|
error_output = ps.output
|
|
|
|
|
|
|
|
if remoteOpts and re.search(r"(on remote machine.*unknown option|"
|
|
|
|
|
|
|
|
"unknown compress name:)",
|
|
|
|
|
|
|
|
error_output):
|
|
|
|
|
|
|
|
if self.syncUserNew(ps, uid, gid, homeDir, "login",
|
|
|
|
|
|
|
|
remoteProfile, host=host):
|
|
|
|
|
|
|
|
return True
|
|
|
|
if re.search(r'change_dir "\?{resPath}" \(in {resName}\) '
|
|
|
|
if re.search(r'change_dir "\?{resPath}" \(in {resName}\) '
|
|
|
|
'failed: No such file or directory'.format(
|
|
|
|
'failed: No such file or directory'.format(
|
|
|
|
resPath=profileName,
|
|
|
|
resPath=profileName,
|
|
|
@ -1365,11 +1377,12 @@ class Client(commandServer, encrypt, Desktop):
|
|
|
|
|
|
|
|
|
|
|
|
def syncUserNew(self, ps, uid, gid, userHome, sync,
|
|
|
|
def syncUserNew(self, ps, uid, gid, userHome, sync,
|
|
|
|
remoteProfile,
|
|
|
|
remoteProfile,
|
|
|
|
host="default", skipList=()):
|
|
|
|
host="default", skipList=(), rsyncopts=()):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
Синхронизация профиля пользователя
|
|
|
|
Синхронизация профиля пользователя
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
execStr = ""
|
|
|
|
execStr = ""
|
|
|
|
|
|
|
|
rsyncopts = list(rsyncopts)
|
|
|
|
skipPaths = self.clVars.Get("cl_sync_skip_path")
|
|
|
|
skipPaths = self.clVars.Get("cl_sync_skip_path")
|
|
|
|
if not skipPaths:
|
|
|
|
if not skipPaths:
|
|
|
|
self.printERROR(
|
|
|
|
self.printERROR(
|
|
|
@ -1410,6 +1423,7 @@ class Client(commandServer, encrypt, Desktop):
|
|
|
|
title = _("Uploading the user profile to %s") % host
|
|
|
|
title = _("Uploading the user profile to %s") % host
|
|
|
|
self.startTask(title)
|
|
|
|
self.startTask(title)
|
|
|
|
self.addProgress()
|
|
|
|
self.addProgress()
|
|
|
|
|
|
|
|
rsyncParams.extend(rsyncopts)
|
|
|
|
|
|
|
|
|
|
|
|
for i in ps.sync("%s/"%source, "%s/"%target, *rsyncParams):
|
|
|
|
for i in ps.sync("%s/"%source, "%s/"%target, *rsyncParams):
|
|
|
|
self.setProgress(i)
|
|
|
|
self.setProgress(i)
|
|
|
|