|
|
|
@ -304,6 +304,11 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable):
|
|
|
|
|
binhost_list = self.Get('cl_update_binhost_list')
|
|
|
|
|
else:
|
|
|
|
|
binhost_list = self.Get('cl_update_binhost_unstable_list')
|
|
|
|
|
if (self.GetBool('cl_update_binhost_stable_opt_set') and
|
|
|
|
|
not self.GetBool('cl_update_binhost_stable_set')):
|
|
|
|
|
stabilization = True
|
|
|
|
|
else:
|
|
|
|
|
stabilization = False
|
|
|
|
|
binhosts_data = Binhosts(
|
|
|
|
|
self.GetInteger('cl_update_binhost_timeout'),
|
|
|
|
|
self.Get('cl_update_binhost_revision_path'),
|
|
|
|
@ -318,8 +323,8 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable):
|
|
|
|
|
ts, t, good, downgrade = binhosts_data.get_timestamp(binhost)
|
|
|
|
|
# условие актуальности текущего сервера
|
|
|
|
|
if ts and good and not downgrade:
|
|
|
|
|
data = binhosts_data.check_binhost(binhost)
|
|
|
|
|
if data:
|
|
|
|
|
status, data = binhosts_data.check_binhost(binhost)
|
|
|
|
|
if status == binhosts_data.BinhostStatus.Success:
|
|
|
|
|
return [[binhost, data, ts, str(t)]]
|
|
|
|
|
|
|
|
|
|
logger = self.get_logger(stub=binhosts_data.is_cache())
|
|
|
|
@ -328,28 +333,38 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable):
|
|
|
|
|
date=time.ctime(), ts=last_ts))
|
|
|
|
|
for host, ts, t, good, downgrade in binhosts_data.get_sorted():
|
|
|
|
|
if ret_val is None:
|
|
|
|
|
data = binhosts_data.check_binhost(host)
|
|
|
|
|
status, data = binhosts_data.check_binhost(host)
|
|
|
|
|
else:
|
|
|
|
|
data = ""
|
|
|
|
|
status, data = binhosts_data.BinhostStatus.UnknownError, ""
|
|
|
|
|
|
|
|
|
|
if not good:
|
|
|
|
|
if ts == "0":
|
|
|
|
|
reason = "FAILED"
|
|
|
|
|
reason = "FAILED (Wrong binhost)"
|
|
|
|
|
data = ""
|
|
|
|
|
t = 0
|
|
|
|
|
else:
|
|
|
|
|
reason = "OUTDATED"
|
|
|
|
|
elif downgrade:
|
|
|
|
|
reason = "SKIP"
|
|
|
|
|
elif not data and ret_val is None:
|
|
|
|
|
reason = "UPDATING"
|
|
|
|
|
errors = {
|
|
|
|
|
binhosts_data.BinhostStatus.Updating: "UPDATING",
|
|
|
|
|
binhosts_data.BinhostStatus.BadEnv:
|
|
|
|
|
"FAILED (Bad env)",
|
|
|
|
|
binhosts_data.BinhostStatus.EnvNotFound:
|
|
|
|
|
"FAILED (Env not found)",
|
|
|
|
|
}
|
|
|
|
|
reason = errors.get(status, "FAILED (Unknown)")
|
|
|
|
|
else:
|
|
|
|
|
reason = ""
|
|
|
|
|
|
|
|
|
|
if ret_val is None and data and (
|
|
|
|
|
not downgrade or stabilization):
|
|
|
|
|
ret_val = [[host, data, ts, str(t)]]
|
|
|
|
|
host = "-> %s" % host
|
|
|
|
|
logger.info("{host:<60} {speed:<7} {timestamp:<10} {reason}".format(
|
|
|
|
|
host=host, speed=float(t) / 1000.0, timestamp=ts,
|
|
|
|
|
reason=reason))
|
|
|
|
|
if ret_val is None and data and not downgrade:
|
|
|
|
|
ret_val = [[host, data, ts, str(t)]]
|
|
|
|
|
return ret_val or [[]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -475,7 +490,7 @@ class VariableClUpdateSyncOverlayRep(ReadonlyVariable):
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return filter(lambda x: x not in ("portage", "gentoo"),
|
|
|
|
|
self.Get('cl_update_sync_rep'))
|
|
|
|
|
self.Get('cl_update_sync_rep'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateOutdateSet(ReadonlyVariable):
|
|
|
|
@ -1510,6 +1525,7 @@ class VariableClUpdateBinhostList(Variable):
|
|
|
|
|
type = "list"
|
|
|
|
|
value = ["ftp://ftp.calculate-linux.ru/calculate"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateBinhostUnstableList(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Список хостов с бинарными обновлениями
|
|
|
|
@ -1517,6 +1533,7 @@ class VariableClUpdateBinhostUnstableList(Variable):
|
|
|
|
|
type = "list"
|
|
|
|
|
value = ["ftp://ftp.calculate-linux.ru/testing"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateBinhostStableSet(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Удлять лишние файлы из репозиториев (например созданные пользователем)
|
|
|
|
@ -1524,6 +1541,7 @@ class VariableClUpdateBinhostStableSet(Variable):
|
|
|
|
|
type = "bool"
|
|
|
|
|
value = "on"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateBinhostStableOptSet(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Удлять лишние файлы из репозиториев (например созданные пользователем)
|
|
|
|
@ -1554,10 +1572,7 @@ class VariableClUpdateBinhostRevisionPath(Variable):
|
|
|
|
|
"""
|
|
|
|
|
type = "list"
|
|
|
|
|
value = [
|
|
|
|
|
"grp/default/ini.env",
|
|
|
|
|
"grp/kde/ini.env",
|
|
|
|
|
"grp/server/ini.env",
|
|
|
|
|
"grp/x/ini.env"
|
|
|
|
|
"grp/ini.env"
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1608,6 +1623,7 @@ class VariableClUpdateEixRepositories(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
Отображаемый список обновляемых репозиториев eix
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return ", ".join(
|
|
|
|
|
x.capitalize() for x in chain(
|
|
|
|
|