From 749af0fdca878342e6fd62eea484a19f362dc1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Wed, 9 Oct 2019 12:48:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D1=81=D0=B2=D0=BE=D0=BF=20=D0=BD=D1=83=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D0=BE=D0=B3=D0=BE=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5?= =?UTF-8?q?=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/install/variables/autopartition.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pym/install/variables/autopartition.py b/pym/install/variables/autopartition.py index 1fe1082..e48bbd3 100644 --- a/pym/install/variables/autopartition.py +++ b/pym/install/variables/autopartition.py @@ -129,6 +129,11 @@ class VariableClAutopartitionSwapSize(SizeHelper, AutopartitionHelper, size = Sizes.G return str(size) + def check(self, value): + if value.isdigit() and int(value) <= Sizes.M: + raise VariableError( + _("Swap size should not be less that 1MiB")) + def humanReadable(self): return humanreadableSize(int(self.Get()))