summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <tails@boum.org>2015-02-20 14:00:12 +0000
committerTails developers <tails@boum.org>2015-02-20 14:00:12 +0000
commit91373fa6218c2ef0fdeecbe41be9beecd8cae775 (patch)
tree5493039de659ac74f42a524e93a5e708ce444c12
parenta2e59fe3fc5cf8f70a8733dc8c97616f8bdd71a6 (diff)
Improved variable and user feedback after code review.
-rw-r--r--features/support/helpers/storage_helper.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/features/support/helpers/storage_helper.rb b/features/support/helpers/storage_helper.rb
index d5aff4f..ed36970 100644
--- a/features/support/helpers/storage_helper.rb
+++ b/features/support/helpers/storage_helper.rb
@@ -72,12 +72,13 @@ class VMStorage
options[:type] ||= "qcow2"
# Require 'slightly' more space to be available to give a bit more leeway
# with rounding, temp file creation, etc.
- extrapadding = 500
- needed = convert_to_MiB(options[:size].to_i, options[:unit]) + extrapadding
+ reserved = 500
+ needed = convert_to_MiB(options[:size].to_i, options[:unit])
avail = convert_to_MiB(get_free_space('host', @pool_path), "KiB")
- assert(avail >= needed, "Error creating disk \"#{name}\" in \"#{@pool_path}\"." +
- "Need #{needed} MiB but only #{avail} MiB is available.")
-
+ assert(avail - reserved >= needed,
+ "Error creating disk \"#{name}\" in \"#{@pool_path}\". " \
+ "Need #{needed} MiB but only #{avail} MiB is available of, " \
+ "which #{reserved} MiB is reserved for other temporary files.")
begin
old_vol = @pool.lookup_volume_by_name(name)
rescue Libvirt::RetrieveError