summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfeczo <szabolcs.feczak@gmail.com>2014-03-19 19:46:09 +1100
committerfeczo <szabolcs.feczak@gmail.com>2014-03-19 19:46:09 +1100
commite7181f03a46f0370051ff90e1b8ce38eb541be03 (patch)
treedc6185091cfae047462cf43480883636c1a241ed
parentce1eb2abb6dfae64e219d72944203443a8ad9d2c (diff)
downloadgoogle-compute-image-packages-e7181f03a46f0370051ff90e1b8ce38eb541be03.tar.gz
Update block_disk.py
in case you specify gcimagebundle -d /dev/sda1 the message is not leading you to specify a disk, it makes you confused about why a single partition is not a single partition
-rw-r--r--gcimagebundle/gcimagebundlelib/block_disk.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcimagebundle/gcimagebundlelib/block_disk.py b/gcimagebundle/gcimagebundlelib/block_disk.py
index 4b3468b..aafc12a 100644
--- a/gcimagebundle/gcimagebundlelib/block_disk.py
+++ b/gcimagebundle/gcimagebundlelib/block_disk.py
@@ -90,7 +90,10 @@ class FsRawDisk(fs_copy.FsCopy):
# Verify there is only 1 partition on the disk
with utils.LoadDiskImage(file_path) as devices:
# For now we only support disks with a single partition.
- if len(devices) != 1:
+ if len(devices) == 0:
+ raise RawDiskError(
+ 'Device %s should be a disk not a partition!' % self._disk)
+ elif len(devices) != 1:
raise RawDiskError(
'Device %s has more than 1 partition. Only devices '
'with a single partition are supported.' % self._disk)