diff options
-rw-r--r-- | dispatch.py | 2 | ||||
-rw-r--r-- | partitioning.py | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/dispatch.py b/dispatch.py index 20f35450e..1203edf2e 100644 --- a/dispatch.py +++ b/dispatch.py @@ -52,7 +52,7 @@ installSteps = [ ( "installtype", ("dispatch", "id", "method", "intf") ), ( "findinstall", ("dispatch", "intf", "id", "instPath") ), ( "partitionmethod", ("id.partitions", "id.instClass") ), - ( "partitionobjinit", partitionObjectsInitialize, ("id.diskset", "id.partitions", "dir") ), + ( "partitionobjinit", partitionObjectsInitialize, ("id.diskset", "id.partitions", "dir", "intf") ), ( "partitionmethodsetup", partitionMethodSetup, ("id.partitions", "dispatch") ), ( "autopartition", ("id.diskset", "id.partitions", "intf", "dispatch") ), ( "autopartitionexecute", doAutoPartition, ("dir", "id.diskset", "id.partitions", "intf")), diff --git a/partitioning.py b/partitioning.py index 49b1bc50c..3e2e103f3 100644 --- a/partitioning.py +++ b/partitioning.py @@ -24,6 +24,7 @@ import math import raid import fsset import os +import sys import iutil from translate import _ from log import log @@ -1022,13 +1023,23 @@ class DiskSet: part = disk.next_partition(part) return rc -def partitionObjectsInitialize(diskset, partitions, dir): +def partitionObjectsInitialize(diskset, partitions, dir, intf): if dir == DISPATCH_BACK: diskset.closeDevices() return # read in drive info diskset.refreshDevices() + + if len(diskset.disks.keys()) == 0: + intf.messageWindow(_("No Drives Found"), + _("An error has occurred - no valid devices were " + "found on which to create new filesystems. " + "Please check your hardware for the cause " + "of this problem.")) + sys.exit(0) + + partitions.setFromDisk(diskset) def partitionMethodSetup(partitions, dispatch): |