[master 1/3] Call is_mpath_member() only when it makes sense
by dashea
From: David Lehman <dlehman(a)redhat.com>
---
blivet/populator/helpers/disklabel.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/blivet/populator/helpers/disklabel.py b/blivet/populator/helpers/disklabel.py
index af2ae51..75e2be6 100644
--- a/blivet/populator/helpers/disklabel.py
+++ b/blivet/populator/helpers/disklabel.py
@@ -43,14 +43,11 @@ class DiskLabelFormatPopulator(FormatPopulator):
@classmethod
def match(cls, data, device):
- is_multipath_member = (device.is_disk and
- blockdev.mpath_is_mpath_member(device.path))
-
# XXX ignore disklabels on multipath or biosraid member disks
return (bool(udev.device_get_disklabel_type(data)) and
not udev.device_is_biosraid_member(data) and
- not is_multipath_member and
- udev.device_get_format(data) != "iso9660")
+ udev.device_get_format(data) != "iso9660" and
+ not (device.is_disk and blockdev.mpath_is_mpath_member(device.path)))
def _get_kwargs(self):
kwargs = super()._get_kwargs()
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/c10440d9e584882550c9c73c3c35...
8 years
Re: [rhinstaller/blivet/pulls/399 2.0-devel] Size tests fix
by dashea
Originally I didn't want to set any default because with storage, it's always a bug to rely on some default rounding. That's also why we always specify the rounding mode in *Blivet*.
As for the ``ROUND_HALF_UP`` I wasn't able to come up with an example of where it could be useful as using such value would always lead to issues. Even when showing to the user in the example above -- the user could tell themselves "Okay, I have 56 GiB of free space so I'm gonna create a 56GiB partition." which would fail. Thus the sizes should have been rounded up (used) and down (free) to prevent such issues.
So what I'm gonna do is:
* add ROUND_HALF_UP to rounding modes in *libbytesize*
* remove the default rounding mode in ``round_to_nearest()`` in *libbytesize*
* set the default rounding mode to ``ROUND_HALF_UP`` in ``round_to_nearest()`` in *Blivet* and add a warning to the docstring that relying on the default rounding mode is always a bug
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/399
8 years