From 71b6a059390e71cb98e070aade10f922b2d88c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Thu, 5 Oct 2017 12:25:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BE=D0=B6=D0=B8=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=20=D1=83=D1=81=D1=82=D1=80=D0=BE=D0=B9=D1=81=D1=82=D0=B2=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D1=82=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/install/install.py | 20 +++++++++++++++++++- pym/install/utils/cl_install.py | 3 ++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/pym/install/install.py b/pym/install/install.py index bc9248b..3d2dc94 100644 --- a/pym/install/install.py +++ b/pym/install/install.py @@ -480,13 +480,31 @@ class Install(MethodsInterface): return not failed - def autopartition(self, scheme_builder, devices): + def wait_devices(self, disks): + """ + Ожидание одного из указанных устройств + """ + for waittime in (0.1, 0.2, 0.5, 1, 2, 4): + disks = [x for x in disks if x and not path.exists(x)] + if not disks: + break + else: + sleep(waittime) + + if disks: + raise InstallError( + _("Failed to found partition %s after creating " + "the partition table") + % ",".join(disks)) + + def autopartition(self, scheme_builder, devices, disks): """ Авторазметка диска входящая переменная - SchemeBuilder """ self.clearLvm(devices) self.clearRaid(devices) scheme_builder.process(DiskFactory()) + self.wait_devices(disks) return True def format(self, target): diff --git a/pym/install/utils/cl_install.py b/pym/install/utils/cl_install.py index 48f0491..af8e5d1 100644 --- a/pym/install/utils/cl_install.py +++ b/pym/install/utils/cl_install.py @@ -45,7 +45,8 @@ class ClInstallAction(Action): {'name': 'autopartition', 'message': __("Creating a new partition table"), 'method': "Install.autopartition(cl_autopartition_scheme_builder," - "cl_autopartition_device)", + "cl_autopartition_device," + "cl_autopartition_disk_dev)", 'condition': lambda dv: dv.Get('cl_autopartition_set') == 'on'}, # форматирование разделов на которые устанавливается дистрибутив {'name': 'format',