From 2ff2810339446b6441833e7e612720403ce092d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD=20=D0=94=D0=B7=D1=8E=D0=B1=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Fri, 29 Oct 2021 10:34:59 +0300 Subject: [PATCH] fixed set level --- pym/update/update.py | 11 ++++++++--- pym/update/variables/update.py | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pym/update/update.py b/pym/update/update.py index ad7daba..c3bb40e 100644 --- a/pym/update/update.py +++ b/pym/update/update.py @@ -20,6 +20,7 @@ import sys from os import path import os import time +from typing_extensions import Required from calculate.core.server.gen_pid import search_worked_process from calculate.core.setup_cache import Cache as SetupCache from calculate.core.server.func import MethodsInterface @@ -1691,7 +1692,8 @@ class Update(MethodsInterface): return True def get_migration_mirror_url(self, host, level): - return f"{host}level{level}" + level_required = int(level) + 1 + return f"{host}level{level_required}" @variable_module("update") def detect_best_binhost(self): @@ -1823,5 +1825,8 @@ class Update(MethodsInterface): return True def update_set_current_level(self): - self.clVars.Set('update.cl_update_level', - Variable.On, force=True) \ No newline at end of file + current_level = int(self.clVars.Get('cl_update_level')) + self.clVars.Write('cl_update_level', + str(current_level + 1), location="system") + self.clVars.Set("update.cl_update_use_migration_host", + Variable.Off) \ No newline at end of file diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 8fa3f55..4da069b 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -1857,11 +1857,11 @@ class VariableClUpdateLevel(Variable): Текущий уровень обновления Используется для выбора зеркала """ - value = "0" + type = "int" class VariableClUpdateUseMigrationHost(Variable): """ - Уровень обновления на бинхосте + Использовать хост миграции """ type = "bool" value = "off"