From a86bd7f1ff8d75ee86b928a549048ae2b5fbf6fe Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Jan 2023 14:13:07 +0300 Subject: [PATCH] =?UTF-8?q?TG-127=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=D1=83=D1=89=D0=B5=D1=81=D1=82=D0=B2=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20.git=20=D0=B2=20=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=82=D0=B5=D0=B9=D0=BD=D0=B5=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/update/utils/cl_update.py | 3 ++- pym/update/variables/update.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pym/update/utils/cl_update.py b/pym/update/utils/cl_update.py index abe6192..321f2a4 100644 --- a/pym/update/utils/cl_update.py +++ b/pym/update/utils/cl_update.py @@ -199,7 +199,8 @@ def get_synchronization_tasks(object_name): 'foreach': 'update.cl_update_other_rep_name', 'message': __("Syncing the {eachvar:capitalize} repository"), 'method': Object('syncOtherRepository(eachvar)'), - 'condition': lambda GetBool: GetBool('update.cl_update_other_set') + 'condition': lambda GetBool: (GetBool('update.cl_update_other_set') or + not GetBool('update.cl_update_other_git_exists')) }, {'name': 'trim_reps', 'foreach': 'update.cl_update_sync_rep', diff --git a/pym/update/variables/update.py b/pym/update/variables/update.py index 32f4531..5eb16d1 100644 --- a/pym/update/variables/update.py +++ b/pym/update/variables/update.py @@ -679,6 +679,21 @@ class VariableClUpdateOtherSet(Variable): return self.value +class VariableClUpdateOtherGitExists(Variable): + """ + Проверка, существует ли папка .git в профиле контейнера + """ + type = 'bool' + repos_path = 'cl_update_repos_storage' + + def get(self): + rep = f"{self.Get(self.repos_path)}/container" + if os.path.exists(os.path.join(rep, '.git')): + return True + return False + + + class VariableClUpdateOtherRepData(ReadonlyTableVariable): """ Информация о прочих репозиториях