Добавление возможности указывать дополнительные точки монтирования

master 3.7.3.1
root 1 year ago
parent 3299c91b38
commit f2b6237246

@ -479,6 +479,15 @@ class VariableClClientUserMountData(ReadonlyTableVariable):
samba_host = self.Get('sr_samba_host')
ftp_host = convertEnv().getVar("ftp", "host")
def map_names(name):
name_dct = {'domain.dmz': 'Санкт-Петербург', 'domain.spb': 'Санкт-Петербург',
'domain.msk': 'Москва', 'domain.verevo': 'Производство'}
for i in name_dct:
if i in name:
return name_dct[i]
else:
return 'error'
def generate():
yield (
"share", "share", path.join(self.Get('ur_home_path'), "Share"),
@ -502,6 +511,15 @@ class VariableClClientUserMountData(ReadonlyTableVariable):
self.Get('cl_replication_host'))
else:
yield ("remote_profile", 'unix', '', '')
try:
for host, mount_path in zip(self.Get('cl_share_hosts'), self.Get('cl_share_mounts')):
resource = host.split('/')[-1]
host = host.replace('//', '', 1).split(f"/{resource}")[0]
if mount_path.startswith('~/'):
mount_path = f"{path.join(self.Get('ur_home_path'), mount_path.replace('~/', '', 1))}"
yield (resource, resource, mount_path, host)
except:
raise GeneratorExit
return list(generate())
@ -551,6 +569,16 @@ class VariableClClientUserMountHost(FieldValue, ReadonlyVariable):
column = 3
class VariableClShareHosts(Variable):
type = "list"
value = []
class VariableClShareMounts(Variable):
type = "list"
value = []
class SyncHelper():
"""
Вспомогательный объект для определения статуса синхронизации и времени

Loading…
Cancel
Save