migration_mirror 3.7.1.3
Иван Дзюбенко 3 years ago
parent 4c1f92d549
commit 3b79f758eb

@ -1575,13 +1575,15 @@ class Update(MethodsInterface):
reason = errors.get(status, self.Reason.UnknownError)
elif binhost.bad_sign:
reason = self.Reason.BadSign
elif not self.is_binhost_level_valid(binhost):
reason = self.Reason.LevelWrong
else:
# SUCCESS
if not binhost.downgraded or stabilization:
host = "-> %s" % host
reason = self.Reason.Success
if not self.is_binhost_level_valid(binhost):
reason = self.Reason.LevelWrong
else:
host = "-> %s" % host
reason = self.Reason.Success
else:
reason = self.Reason.Skip
elif binhost.downgraded:
@ -1653,7 +1655,7 @@ class Update(MethodsInterface):
self.clVars.Set("update.cl_update_use_migration_host", Variable.On)
#TODO translate
raise UpdateError(
_("Current binhost {} has wrong update level. Current level: {} Binhost level: {}").\
_("Current binhost {} has a wrong update level. Current level: {} Binhost level: {}").\
format(binhost_url, self.clVars.Get("update.cl_update_level"), binhost.level, ))
elif binhost.outdated:
raise UpdateError(
@ -1689,7 +1691,7 @@ class Update(MethodsInterface):
return True
def get_migration_mirror_url(self, host, level):
return f"{host}level{level}/"
return f"{host}level{level}"
@variable_module("update")
def detect_best_binhost(self):
@ -1710,7 +1712,6 @@ class Update(MethodsInterface):
return True
def set_migration_host(self):
print("TESTTEST")
retval = []
dv = self.clVars
last_ts = dv.Get('cl_update_last_timestamp')
@ -1718,7 +1719,6 @@ class Update(MethodsInterface):
level = self.clVars.Get('update.cl_update_level')
binhost_list = [self.get_migration_mirror_url(x, level) for x in binhost_list]
binhosts_data = Binhosts(
# значение малозначимо, поэтому берётся из собирающей системы
dv.GetInteger('cl_update_binhost_timeout'),
dv.Get('cl_update_binhost_revision_path'),
dv.Get('cl_update_binhost_timestamp_path'),
@ -1729,7 +1729,11 @@ class Update(MethodsInterface):
retval.append([migration_host.host, migration_host.data,
str(migration_host.timestamp),
str(migration_host.duration)])
return retval
self.clVars.Set('update.cl_update_binhost_data',
retval or Variable.EmptyTable, force=True)
self.endTask()
return True
def update_rep_list(self):
@ -1817,9 +1821,7 @@ class Update(MethodsInterface):
except Exception:
pass
return True
def update_set_current_level(self):
# print("DEBUG")
# self.clVars.Get('update.cl_update_binhost'))
self.printSUCCESS(_("UPDATE LEVEL %s") % self.clVars.Get('update.cl_update_level'))
return True
self.clVars.Set('update.cl_update_level',
Variable.On, force=True)

@ -451,10 +451,12 @@ class ClUpdateAction(Action):
'depend': Tasks.failed()
},
# #TODO
# {'name': 'update:set_current_level',
# 'method': 'Update.update_set_current_level()',
# 'condition': lambda Get: Get('cl_update_sync_only_set') == 'off'
# },
{'name': 'update:set_current_level',
'method': 'Update.update_set_current_level()',
'depend': Tasks.success(),
'condition': lambda Get: Get('cl_update_sync_only_set') == 'off' and
Get('update.cl_update_use_migration_host') == 'on'
},
# сообщение удачного завершения при обновлении ревизии
{'name': 'success_rev',
'message': __("System update finished!"),

@ -1566,7 +1566,6 @@ class VariableClUpdateBinhostMigrationList(Variable):
Список хостов с бинарными обновлениями для стабильной миграции
"""
type = "list"
#TODO placeholder
value = ["https://mirror.calculate-linux.org/migrate/"]
class VariableClUpdateBinhostBase(Variable):
@ -1858,7 +1857,7 @@ class VariableClUpdateLevel(Variable):
Текущий уровень обновления
Используется для выбора зеркала
"""
value = "1"
value = "0"
class VariableClUpdateUseMigrationHost(Variable):
"""

Loading…
Cancel
Save