Пример #1
0
        def doSizeSanityCheck(self):
            """Sanity check that the size of the partition is sane."""
            if not self.fstype:
                return None
            if not self.format:
                return None
            ret = RequestSpec.doSizeSanityCheck(self)
            if ret is not None:
                return ret

            if (self.size and self.maxSizeMB
                and (self.size > self.maxSizeMB)):
                return (_("The size of the requested partition (size = %s MB) "
                          "exceeds the maximum size of %s MB.")
                        % (self.size, self.maxSizeMB))

            if self.size and self.size < 0:
                return _("The size of the requested partition is "
                         "negative! (size = %s MB)") % (self.size)
            return None