From 319f9a2aecda97fc03801d19e7cb26c0df404fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Mon, 26 Jun 2017 11:40:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=20=D1=82=D0=B8?= =?UTF-8?q?=D0=BF=D0=B0=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=B0=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/install/install.py | 5 ++++- pym/install/variables/system.py | 13 ++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pym/install/install.py b/pym/install/install.py index 997e134..3ac8cd8 100644 --- a/pym/install/install.py +++ b/pym/install/install.py @@ -579,12 +579,15 @@ class Install(MethodsInterface): """ Обновить список локальных администраторов при установке """ + aliases = { + 'update': 'system_update', + } install_admin = Admins(self.clVars, chroot=True) install_admin.clear() for k,v in self.clVars.select('install.cl_migrate_user', 'install.cl_migrate_admin', install_cl_migrate_admin__ne=""): - install_admin[k] = v + install_admin[k] = aliases.get(v,v) install_admin.save() return True diff --git a/pym/install/variables/system.py b/pym/install/variables/system.py index ea676fc..6c474ab 100644 --- a/pym/install/variables/system.py +++ b/pym/install/variables/system.py @@ -314,6 +314,11 @@ class VariableClMigrateData(UserHelper, TableVariable): self.label = _("Migrating users") def set(self, value): + value = [ + [x[0], {'none':''}.get(x[1],x[1]), + x[2],x[3]] + for x in value + ] if len(value) == 1: if len(value[0]) > 1 and value[0][0] == 'none': return [[]] @@ -359,6 +364,7 @@ class VariableClMigrateAdmin(UserHelper, Variable): """ type = 'choice-list' default_value = "" + aliases = {'system_update': 'update'} def init(self): self.label = _("Administrator") @@ -370,17 +376,18 @@ class VariableClMigrateAdmin(UserHelper, Variable): ("update", _("System update")), ] + def get_alias(self, value): + return self.aliases.get(value, value) + def get(self): """ Migrating users (users above 1000 uid) """ admins = Admins(self.parent) - return [admins[x] or self.default_value + return [self.get_alias(admins[x]) or self.default_value for x in self.Get('cl_migrate_user')] def set(self, value): - name_map = {'update':'system_update', 'none':''} - value = map(lambda x:name_map.get(x,x), value) return map(lambda x: x if x else self.default_value, value)