diff --git a/pym/client/variables/client.py b/pym/client/variables/client.py index 8a5cb0e..d8ff851 100644 --- a/pym/client/variables/client.py +++ b/pym/client/variables/client.py @@ -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(): """ Вспомогательный объект для определения статуса синхронизации и времени