|
|
|
@ -300,17 +300,21 @@ 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'):
|
|
|
|
|
binhost_list = self.Get('cl_update_binhost_list')
|
|
|
|
|
else:
|
|
|
|
|
binhost_list = self.Get('cl_update_binhost_unstable_list')
|
|
|
|
|
binhosts_data = Binhosts(
|
|
|
|
|
self.GetInteger('cl_update_binhost_timeout'),
|
|
|
|
|
self.Get('cl_update_binhost_revision_path'),
|
|
|
|
|
self.Get('cl_update_binhost_timestamp_path'),
|
|
|
|
|
last_ts,
|
|
|
|
|
self.Get('cl_update_binhost_list')
|
|
|
|
|
binhost_list
|
|
|
|
|
)
|
|
|
|
|
binhost = self.Get('cl_update_binhost')
|
|
|
|
|
recheck = self.GetBool('cl_update_binhost_recheck_set')
|
|
|
|
|
|
|
|
|
|
if not recheck and binhost:
|
|
|
|
|
if not recheck and binhost and binhost in binhost_list:
|
|
|
|
|
ts, t, good, downgrade = binhosts_data.get_timestamp(binhost)
|
|
|
|
|
# условие актуальности текущего сервера
|
|
|
|
|
if ts and good and not downgrade:
|
|
|
|
@ -333,7 +337,11 @@ class VariableClUpdateBinhostData(ReadonlyTableVariable):
|
|
|
|
|
data = ""
|
|
|
|
|
|
|
|
|
|
if not good:
|
|
|
|
|
reason = "OUTDATED"
|
|
|
|
|
if ts == "0":
|
|
|
|
|
reason = "FAILED"
|
|
|
|
|
t = 0
|
|
|
|
|
else:
|
|
|
|
|
reason = "OUTDATED"
|
|
|
|
|
elif downgrade:
|
|
|
|
|
reason = "SKIP"
|
|
|
|
|
elif not data and ret_val is None:
|
|
|
|
@ -1265,7 +1273,7 @@ class DataVarsUpdateProfile(SimpleDataVars):
|
|
|
|
|
'cl_update_rep_rev',
|
|
|
|
|
'cl_update_branch_name']
|
|
|
|
|
|
|
|
|
|
def __init__(self, profile, chroot_path='/', recheck=None):
|
|
|
|
|
def __init__(self, profile, chroot_path='/', recheck=None, stable=None):
|
|
|
|
|
SimpleDataVars.__init__(
|
|
|
|
|
self,
|
|
|
|
|
lib_linux.VariableOsLinuxName(),
|
|
|
|
@ -1303,12 +1311,16 @@ class DataVarsUpdateProfile(SimpleDataVars):
|
|
|
|
|
VariableClUpdateBinhostTimeout(section="update"),
|
|
|
|
|
VariableClUpdateBinhostTimestampPath(section="update"),
|
|
|
|
|
VariableClUpdateBinhostList(section="update"),
|
|
|
|
|
VariableClUpdateBinhostUnstableList(section="update"),
|
|
|
|
|
VariableClUpdateBinhostStableSet(section="update"),
|
|
|
|
|
VariableClUpdateBinhostRevisionPath(section="update"),
|
|
|
|
|
)
|
|
|
|
|
self['cl_profile_system'] = profile
|
|
|
|
|
self['cl_chroot_path'] = chroot_path
|
|
|
|
|
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.flIniFileFrom(profile)
|
|
|
|
|
|
|
|
|
|
def __repr__(self):
|
|
|
|
@ -1499,7 +1511,28 @@ class VariableClUpdateBinhostList(Variable):
|
|
|
|
|
Список хостов с бинарными обновлениями
|
|
|
|
|
"""
|
|
|
|
|
type = "list"
|
|
|
|
|
value = ["ftp://ftp.calculate-linux.ru/pub/calculate"]
|
|
|
|
|
value = ["ftp://ftp.calculate-linux.ru/calculate"]
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateBinhostUnstableList(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Список хостов с бинарными обновлениями
|
|
|
|
|
"""
|
|
|
|
|
type = "list"
|
|
|
|
|
value = ["ftp://ftp.calculate-linux.ru/testing"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateBinhostStableSet(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Удлять лишние файлы из репозиториев (например созданные пользователем)
|
|
|
|
|
"""
|
|
|
|
|
type = "bool"
|
|
|
|
|
value = "on"
|
|
|
|
|
|
|
|
|
|
opt = ["--stable"]
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Check the repositories integrity")
|
|
|
|
|
self.help = _("use only stable updates")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClUpdateBinhost(Variable):
|
|
|
|
@ -1571,6 +1604,6 @@ class VariableClUpdateEixRepositories(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
def get(self):
|
|
|
|
|
return ", ".join(
|
|
|
|
|
x for x in chain(
|
|
|
|
|
x.capitalize() for x in chain(
|
|
|
|
|
reversed(self.Get('update.cl_update_rep_name')),
|
|
|
|
|
self.Get('update.cl_update_other_rep_name')))
|
|
|
|
|