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',