From a087ecad893c76e328082a64050c9cd36b4c9eb3 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: Thu, 31 Mar 2016 13:05:16 +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=D0=BE=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20testing=20=D1=81=D0=B5?= =?UTF-8?q?=D1=80=D0=B2=D0=B5=D1=80=D0=B0=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/update.py | 14 +++++++++----- pym/update/variables/update.py | 20 +++++++++++++------- pym/update/wsdl_update.py | 3 ++- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index 2d1c53c..e221ad0 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -1023,6 +1023,7 @@ class Update(MethodsInterface): 'cl_update_binhost_list', 'cl_update_binhost_unstable_list', 'cl_update_binhost_stable_set', + 'cl_update_binhost_stable_opt_set', 'cl_update_branch_name', 'cl_profile_system', 'cl_update_rep'): @@ -1177,11 +1178,6 @@ class Update(MethodsInterface): if hosts[0] != self.clVars.Get('update.cl_update_binhost'): self.refresh_binhost = True self.clVars.Write('cl_update_binhost', hosts[0], location="system") - if self.clVars.Get('cl_action') == 'update': - self.clVars.Write( - 'cl_update_binhost_stable_set', - self.clVars.Get('update.cl_update_binhost_stable_set'), - location="system") new_ts = self.clVars.Get("update.cl_update_binhost_timestamp") if new_ts: new_ts = new_ts[0] @@ -1190,6 +1186,14 @@ class Update(MethodsInterface): int(new_ts) > int(old_ts)): ini = SystemIni(self.clVars) ini.setVar('update', {'last_update': new_ts}) + if self.clVars.Get('cl_action') == 'sync': + value = self.clVars.GetBool('cl_update_binhost_stable_set') + new_value = self.clVars.GetBool('cl_update_binhost_stable_opt_set') + if value != new_value: + self.clVars.Write( + 'cl_update_binhost_stable_set', + self.clVars.Get('update.cl_update_binhost_stable_opt_set'), + location="system") return True def message_binhost_changed(self): diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index fadc949..56b4064 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -300,7 +300,7 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable): def get(self, hr=HumanReadable.No): last_ts = self.Get('cl_update_last_timestamp') - if self.GetBool('cl_update_binhost_stable_set'): + if self.GetBool('cl_update_binhost_stable_opt_set'): binhost_list = self.Get('cl_update_binhost_list') else: binhost_list = self.Get('cl_update_binhost_unstable_list') @@ -324,10 +324,6 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable): logger = self.get_logger(stub=binhosts_data.is_cache()) ret_val = None - # TODO: важно еще сверу коммент - # отладочная строка - # необходимо разобраться почему calculate-builder вызывает - # заполнение несколько раз!!!!!!!!!!!! logger.info("Started scan on: {date}, current timestamp: {ts}".format( date=time.ctime(), ts=last_ts)) for host, ts, t, good, downgrade in binhosts_data.get_sorted(): @@ -1313,6 +1309,7 @@ class DataVarsUpdateProfile(SimpleDataVars): VariableClUpdateBinhostList(section="update"), VariableClUpdateBinhostUnstableList(section="update"), VariableClUpdateBinhostStableSet(section="update"), + VariableClUpdateBinhostStableOptSet(section="update"), VariableClUpdateBinhostRevisionPath(section="update"), ) self['cl_profile_system'] = profile @@ -1320,7 +1317,7 @@ class DataVarsUpdateProfile(SimpleDataVars): if recheck is not None: self['cl_update_binhost_recheck_set'] = recheck if stable is not None: - self['cl_update_binhost_stable_set'] = stable + self['cl_update_binhost_stable_opt_set'] = stable self.flIniFileFrom(profile) def __repr__(self): @@ -1520,7 +1517,6 @@ class VariableClUpdateBinhostUnstableList(Variable): type = "list" value = ["ftp://ftp.calculate-linux.ru/testing"] - class VariableClUpdateBinhostStableSet(Variable): """ Удлять лишние файлы из репозиториев (например созданные пользователем) @@ -1528,12 +1524,22 @@ class VariableClUpdateBinhostStableSet(Variable): type = "bool" value = "on" +class VariableClUpdateBinhostStableOptSet(Variable): + """ + Удлять лишние файлы из репозиториев (например созданные пользователем) + """ + type = "bool" + value = "on" + opt = ["--stable"] def init(self): self.label = _("Check the repositories integrity") self.help = _("use only stable updates") + def get(self): + return self.Get('cl_update_binhost_stable_set') + class VariableClUpdateBinhost(Variable): """ diff --git a/pym/update/wsdl_update.py b/pym/update/wsdl_update.py index 46e74fa..2503e64 100644 --- a/pym/update/wsdl_update.py +++ b/pym/update/wsdl_update.py @@ -64,7 +64,8 @@ class Wsdl(WsdlBase): # описание груп (список лямбда функций) 'groups': [ lambda group: group(_("Update the system"), - normal=('cl_update_binhost_stable_set',), + normal=( + 'cl_update_binhost_stable_opt_set',), expert=( 'cl_update_sync_only_set', 'cl_update_other_set',