Добавлено ожидание устройств при авторазметке

master-3.5
parent e7cefcd6e2
commit 71b6a05939

@ -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):

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

Loading…
Cancel
Save