Skip to content

Commit

Permalink
Take swap into account for home limit
Browse files Browse the repository at this point in the history
  • Loading branch information
shundhammer committed Aug 23, 2018
1 parent b6363f7 commit 3db4782
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/modules/StorageProposal.rb
Expand Up @@ -3975,16 +3975,15 @@ def get_proposal(have_swap, disk)
avail_size = get_avail_size_mb(Ops.get_list(disk, "partitions", []))
if !have_swap
swap_sizes = get_swap_sizes(avail_size)
swap_size_mb = swap_sizes[0] || 256
swap = {
"mount" => "swap",
"increasable" => true,
"fsys" => :swap,
"maxsize" => 2 * 1024 * 1024 * 1024,
"size" => Ops.multiply(
Ops.multiply(Ops.get(swap_sizes, 0, 256), 1024),
1024
)
"size" => swap_size_mb * 1024 * 1024
}
avail_size -= swap_size_mb
Ops.set(
conf,
"partitions",
Expand Down

0 comments on commit 3db4782

Please sign in to comment.