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