From e3a0dc3218e5c119b2cf71c282dd4cdf7c8987e8 Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Wed, 9 Oct 2019 10:21:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D1=8B?= =?UTF-8?q?=20=D0=BE=D0=BA=D1=80=D1=83=D0=B3=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BC=D0=B5=D1=82=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/calculate/lib/utils/partition.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pym/calculate/lib/utils/partition.py b/pym/calculate/lib/utils/partition.py index 66a7a58..619a13b 100644 --- a/pym/calculate/lib/utils/partition.py +++ b/pym/calculate/lib/utils/partition.py @@ -630,13 +630,15 @@ class RoundableVolumesBuilder(VolumesBuilder): def is_roundable_size(self, size): if (size is not VolumesBuilder.SizeAllFree and size and - abs(size - self.free_size) < size * self.rounding): + abs(size - self.free_size) < min(size * self.rounding, + 100 * Sizes.M)): return True return False def refined_size(self, size): if size is VolumesBuilder.SizeAllFree and self.minimal: - if self.minimal > self.free_size: + if (self.minimal > self.free_size and + not self.is_roundable_size(self.minimal)): return self.minimal if self.last_partition: if self.is_roundable_size(size): @@ -1040,7 +1042,7 @@ class SchemeBuilder(object): self.update = False self.calculate = False self.rootall = False - self.rounding = 0.01 + self.rounding = 0.1 self.vgname = "calculate" self.extsize = None