[rhinstaller/anaconda/pulls/424 master] Fix bad space needed messages

vpodzime installerbot-noreply at redhat.com
Mon Oct 26 09:04:48 UTC 2015


> @@ -95,6 +97,13 @@ def __init__(self, data, storage, payload):
>          self._deleteButton = self.builder.get_object("deleteButton")
>          self._resizeSlider = self.builder.get_object("resizeSlider")
>  
> +    def _updateRequiredSpace(self):
> +        space_required = self.payload.spaceRequired
> +        # get real required space
> +        # BTRFS is used here because it's FS with biggest space taken by metadata
> +        space_required = Size(Decimal(space_required) / Decimal(BTRFS.MetadataSizeFactor))
> +        return space_required.roundToNearest(Size("1 MiB"), rounding=ROUND_UP)
> +

A few suggestions here:
  * the newly added thing should be a property
  * and it should have a name that doesn't sound like does something else than calculating and returning a value (maybe something like ``_payloadRequiredSize``?)
  * I don't think working with BTRFS explicitly here is a good thing to do -- BTRFS' meta data requirements may change in a week and then it will be a different file system we would need to take into account here. So blivet should probably provide something like *the_most_hungry_FS* (giving the class and the size md size factor) and we should use that here

-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/424#discussion_r42970548


More information about the anaconda-patches mailing list