diff options
author | Neil Williams <codehelp@debian.org> | 2016-03-13 15:10:46 +0000 |
---|---|---|
committer | Neil Williams <codehelp@debian.org> | 2016-03-13 15:18:16 +0000 |
commit | 748bbd7ca24d3f54ab410fa18a39301a4afa8900 (patch) | |
tree | 3c8906696256f6545a123fa27e9e1c17bdb6285c /bin | |
parent | 33b3f0eb04201214f7a653db329f7ec23e1c1973 (diff) | |
download | vmdebootstrap-748bbd7ca24d3f54ab410fa18a39301a4afa8900.tar.gz |
Fail if the size is too small for a bootstrap
Catch typos in the size option which would cause images which
are much too small for a bootstrap to be created.
Bug: #811464
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/vmdebootstrap | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap index b65a282..82dcfd7 100755 --- a/bin/vmdebootstrap +++ b/bin/vmdebootstrap @@ -147,6 +147,10 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth raise cliapp.AppException( 'You must give disk image filename or use either a ' 'tarball filename or use squash') + if self.settings['size'] <= 100000000: + raise cliapp.AppException( + 'A size of %s bytes is too small for a ' + 'bootstrap.' % self.settings['size']) if self.settings['image'] and not self.settings['size']: raise cliapp.AppException( 'If disk image is specified, you must give image size.') |