fixed cl-builder-update crash when host machine doesn't have a chosen

binhost
master 3.7.2.4
idziubenko 2 years ago
parent 10b5a0132d
commit 489ec1a7a5

@ -1694,7 +1694,7 @@ class Update(MethodsInterface):
return f"{host}level{level_required}"
@variable_module("update")
def detect_best_binhost(self):
def detect_best_binhost(self, cl_check_update_level):
# выполняется переход с серверов unstable обновлении на stable
# в этом случае не важно, что бинари могут старее текущих
if (self.clVars.GetBool('cl_update_binhost_stable_opt_set') and
@ -1702,7 +1702,9 @@ class Update(MethodsInterface):
stabilization = True
else:
stabilization = False
ignore_level = self.clVars.Get("cl_check_update_level") == Variable.Off
#had to extract ignore level logic to cl_update because of variable module
ignore_level = not cl_check_update_level
# ignore_level = self.clVars.Get('cl_check_update_level') == Variable.Off
current_level_is_valid = self.check_current_level() if not ignore_level else None
self.startTask(_("Searching new binhost"))
retval = self._search_best_binhost(self.binhosts_data,

@ -73,7 +73,7 @@ def get_synchronization_tasks(object_name):
'tasks': [
# найти лучший сервер обновлений
{'name': 'detect_best_binhost',
'method': Object('detect_best_binhost()'),
'method': Object(f'detect_best_binhost({object_name.lower()}.cl_check_update_level)'),
'essential': False,
'depend': (Tasks.success() & ~AllTasks.has_any("not_use_search") &
(~AllTasks.success_one_of("check_current_binhost") |
@ -123,7 +123,7 @@ def get_synchronization_tasks(object_name):
{'name': 'sync_reps:update_packages_cache',
'message': __("Update packages index"),
'method': Object('download_packages(update.cl_update_portage_binhost,'
'update.cl_update_package_cache,update.cl_update_package_cache_sign,'
'update.cl_update_package_cache, update.cl_update_package_cache_sign,'
'update.cl_update_gpg)'),
'essential': False,
'condition': lambda Get, GetBool: (

Loading…
Cancel
Save