Compare commits
11 Commits
8b4141063f
...
76aab611eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76aab611eb | ||
|
|
74a00de8a8 | ||
|
|
67659b4ea5 | ||
|
|
3318e3c367 | ||
|
|
e025368735 | ||
|
|
03c97840b7 | ||
|
|
01eb6920de | ||
|
|
f698f60fe7 | ||
|
|
3dfd5a44bc | ||
|
|
f8de75b2b6 | ||
|
|
17c1b68eca |
124
backport-Do-not-allow-setting-chunk-size-for-RAID1.patch
Normal file
124
backport-Do-not-allow-setting-chunk-size-for-RAID1.patch
Normal file
@ -0,0 +1,124 @@
|
||||
From 6e34d491e5f930af42a407bd3ef9d16553bf7ee4 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 23 Aug 2021 15:14:49 +0200
|
||||
Subject: [PATCH 1/2] pylint: Ignore false positive assignment-from-no-return
|
||||
warning
|
||||
|
||||
---
|
||||
blivetgui/communication/proxy_utils.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/blivetgui/communication/proxy_utils.py b/blivetgui/communication/proxy_utils.py
|
||||
index 4888e2b..ec822e4 100644
|
||||
--- a/blivetgui/communication/proxy_utils.py
|
||||
+++ b/blivetgui/communication/proxy_utils.py
|
||||
@@ -59,7 +59,7 @@ class ProxyID(object):
|
||||
_newid_gen = functools.partial(next, itertools.count())
|
||||
|
||||
def __init__(self):
|
||||
- self.id = self._newid_gen()
|
||||
+ self.id = self._newid_gen() # pylint: disable=assignment-from-no-return
|
||||
|
||||
def __repr__(self):
|
||||
return "'Proxy ID, %s'" % self.id
|
||||
|
||||
From dec1f8d481c19eeed91b6f740cdcbcb9487daf21 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 23 Aug 2021 15:15:16 +0200
|
||||
Subject: [PATCH 2/2] Do not allow setting chunk size for RAID 1 (#1996223)
|
||||
|
||||
RAID 1 doesn't support chunk size, we shouldn't allow to set it in
|
||||
the UI and also stop to set the default 512 KiB. See also
|
||||
https://github.com/storaged-project/blivet/pull/969
|
||||
---
|
||||
blivetgui/blivet_utils.py | 6 +++++-
|
||||
blivetgui/dialogs/add_dialog.py | 15 ++++++++++++---
|
||||
tests/blivetgui_tests/add_dialog_test.py | 12 ++++++++++++
|
||||
3 files changed, 29 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/blivetgui/blivet_utils.py b/blivetgui/blivet_utils.py
|
||||
index aa2b72f..6fe99a7 100644
|
||||
--- a/blivetgui/blivet_utils.py
|
||||
+++ b/blivetgui/blivet_utils.py
|
||||
@@ -1209,12 +1209,16 @@ def _create_mdraid(self, user_input):
|
||||
actions.extend(part_actions)
|
||||
|
||||
md_parents = [ac.device for ac in actions if ac.is_format and ac._format.type == "mdmember"]
|
||||
+ if user_input.advanced:
|
||||
+ chunk_size = user_input.advanced["chunk_size"]
|
||||
+ else:
|
||||
+ chunk_size = None
|
||||
new_md = MDRaidArrayDevice(parents=md_parents,
|
||||
name=device_name,
|
||||
level=user_input.raid_level,
|
||||
member_devices=len(md_parents),
|
||||
total_devices=len(md_parents),
|
||||
- chunk_size=user_input.advanced["chunk_size"])
|
||||
+ chunk_size=chunk_size)
|
||||
actions.append(blivet.deviceaction.ActionCreateDevice(new_md))
|
||||
|
||||
if user_input.encrypt:
|
||||
diff --git a/blivetgui/dialogs/add_dialog.py b/blivetgui/dialogs/add_dialog.py
|
||||
index 2cb437d..81da95c 100644
|
||||
--- a/blivetgui/dialogs/add_dialog.py
|
||||
+++ b/blivetgui/dialogs/add_dialog.py
|
||||
@@ -489,6 +489,10 @@ def update_raid_type_chooser(self, keep_selection=False):
|
||||
def on_raid_type_changed(self, _widget):
|
||||
self.add_size_area()
|
||||
|
||||
+ if self.selected_type == "mdraid":
|
||||
+ self.add_advanced_options()
|
||||
+ self.show_widgets(["advanced"])
|
||||
+
|
||||
def select_selected_free_region(self):
|
||||
""" In parent list select the free region user selected checkbox as checked
|
||||
"""
|
||||
@@ -859,10 +863,15 @@ def add_advanced_options(self):
|
||||
self.advanced.destroy()
|
||||
|
||||
if device_type in ("lvm", "lvmvg", "partition", "mdraid"):
|
||||
- self.advanced = AdvancedOptions(self, device_type, self.selected_parent, self.selected_free)
|
||||
- self.widgets_dict["advanced"] = [self.advanced]
|
||||
+ if device_type == "mdraid" and self._raid_chooser.selected_level.name == "raid1":
|
||||
+ self.advanced = None
|
||||
+ self.widgets_dict["advanced"] = []
|
||||
+ else:
|
||||
+ self.advanced = AdvancedOptions(self, device_type, self.selected_parent,
|
||||
+ self.selected_free)
|
||||
+ self.widgets_dict["advanced"] = [self.advanced]
|
||||
|
||||
- self.grid.attach(self.advanced.expander, 0, 15, 6, 1)
|
||||
+ self.grid.attach(self.advanced.expander, 0, 15, 6, 1)
|
||||
|
||||
else:
|
||||
self.advanced = None
|
||||
diff --git a/tests/blivetgui_tests/add_dialog_test.py b/tests/blivetgui_tests/add_dialog_test.py
|
||||
index 4a53ca5..9d1b3e6 100644
|
||||
--- a/tests/blivetgui_tests/add_dialog_test.py
|
||||
+++ b/tests/blivetgui_tests/add_dialog_test.py
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
from blivet.size import Size
|
||||
from blivet import formats
|
||||
+from blivet.devicelibs import raid
|
||||
|
||||
|
||||
def supported_filesystems():
|
||||
@@ -583,6 +584,17 @@ def test_raid_type(self):
|
||||
# raid0 type is selected --> we should have 2 size areas, both with max size 4 GiB (smaller free space size)
|
||||
self.assertEqual(add_dialog.size_area.max_size, Size("8 GiB"))
|
||||
|
||||
+ # raid0 is selected --> advanced options (chunk size) should be visible
|
||||
+ self.assertIsNotNone(add_dialog.advanced)
|
||||
+
|
||||
+ # select raid1 --> advanced options (chunk size) should be disappear
|
||||
+ add_dialog._raid_chooser.selected_level = raid.RAID1
|
||||
+ self.assertIsNone(add_dialog.advanced)
|
||||
+
|
||||
+ # back to raid0 just to be sure
|
||||
+ add_dialog._raid_chooser.selected_level = raid.RAID0
|
||||
+ self.assertIsNotNone(add_dialog.advanced)
|
||||
+
|
||||
@patch("blivetgui.dialogs.message_dialogs.ErrorDialog", error_dialog)
|
||||
def test_mountpoint_validity_check(self):
|
||||
parent_device = self._get_parent_device()
|
||||
@ -0,0 +1,35 @@
|
||||
From 083c30a02f9335965fc1b27984e39f6fe443c590 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 21 Sep 2021 12:44:26 +0200
|
||||
Subject: [PATCH] Fix DeviceFormatError when removing a non-existing MD array
|
||||
|
||||
We can't run format.teardown() for formats that have not been
|
||||
created yet.
|
||||
|
||||
Resolves: rhbz#2005289
|
||||
---
|
||||
blivetgui/blivet_utils.py | 11 ++++++-----
|
||||
1 file changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/blivetgui/blivet_utils.py b/blivetgui/blivet_utils.py
|
||||
index 6fe99a7..e7d23da 100644
|
||||
--- a/blivetgui/blivet_utils.py
|
||||
+++ b/blivetgui/blivet_utils.py
|
||||
@@ -598,11 +598,12 @@ def delete_device(self, blivet_device, delete_parents):
|
||||
# the mdmember format from the parents
|
||||
if blivet_device.type == "mdarray":
|
||||
for parent in blivet_device.parents:
|
||||
- try:
|
||||
- parent.format.teardown()
|
||||
- except Exception as e: # pylint: disable=broad-except
|
||||
- return ProxyDataContainer(success=False, actions=None, message=None, exception=e,
|
||||
- traceback=traceback.format_exc())
|
||||
+ if parent.format.exists:
|
||||
+ try:
|
||||
+ parent.format.teardown()
|
||||
+ except Exception as e: # pylint: disable=broad-except
|
||||
+ return ProxyDataContainer(success=False, actions=None, message=None, exception=e,
|
||||
+ traceback=traceback.format_exc())
|
||||
result = self._delete_format(parent)
|
||||
if not result.success:
|
||||
return result
|
||||
Binary file not shown.
BIN
blivet-gui-2.3.0.tar.gz
Normal file
BIN
blivet-gui-2.3.0.tar.gz
Normal file
Binary file not shown.
@ -1,16 +1,22 @@
|
||||
Name: blivet-gui
|
||||
Version: 2.1.15
|
||||
Release: 1
|
||||
Version: 2.3.0
|
||||
Release: 3
|
||||
Summary: Tool for data storage configuration
|
||||
License: GPLv2+
|
||||
URL: https://github.com/storaged-project/blivet-gui
|
||||
Source0: https://github.com/storaged-project/blivet-gui/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||
Source0: https://github.com/storaged-project/blivet-gui/releases/download/%{version}-1/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch0: backport-Do-not-allow-setting-chunk-size-for-RAID1.patch
|
||||
Patch1: backport-fix-device-format-error-when-removing-a-non-existing.patch
|
||||
Patch2: skip-brtfs-raid-test-if-no-support.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: desktop-file-utils libappstream-glib python3-devel gettext python3-setuptools
|
||||
BuildRequires: desktop-file-utils libappstream-glib python3-devel gettext >= 0.18.3 python3-setuptools
|
||||
#required by test
|
||||
BuildRequires: python3-six python3-gobject-base python3-blivet xorg-x11-server-Xvfb
|
||||
|
||||
Requires: python3 python3-gobject gettext python3-blivet gtk3
|
||||
Requires: PolicyKit-authentication-agent python3-pid libreport adwaita-icon-theme
|
||||
Requires: PolicyKit-authentication-agent python3-pid libreport
|
||||
|
||||
Provides: %{name}-runtime
|
||||
Obsoletes: %{name}-runtime
|
||||
@ -22,7 +28,7 @@ Graphical (GTK) tool for manipulation and configuration of data storage
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -p1 -n %{name}-%{version}
|
||||
|
||||
%build
|
||||
%make_build
|
||||
@ -34,6 +40,9 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/blivet-gui.desktop
|
||||
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/blivet-gui.appdata.xml
|
||||
install -d %{buildroot}/%{_localstatedir}/log/blivet-gui
|
||||
|
||||
%check
|
||||
make test
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING
|
||||
@ -54,6 +63,30 @@ install -d %{buildroot}/%{_localstatedir}/log/blivet-gui
|
||||
%{_mandir}/man1/blivet-gui.1*
|
||||
|
||||
%changelog
|
||||
* Thu Sep 28 2023 zhouyihang<zhouyihang3@h-partners.com> - 2.3.0-3
|
||||
- Type:requirements
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:enable test
|
||||
|
||||
* Fri May 13 2022 haomimi <haomimi@uniontech.com> - 2.3.0-2
|
||||
- fix "bogus date %changelog" for spec file
|
||||
|
||||
* Wed Dec 22 2021 xihaochen<xihaochen@huawei.com> - 2.3.0-1
|
||||
- Type:requirements
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update blivet-gui to 2.3.0
|
||||
|
||||
* Thu Sep 10 2020 hanzhijun <hanzhijun1@huawei.com> - 2.1.15-3
|
||||
- solve source url problem
|
||||
|
||||
* Fri Sep 4 2020 gaihuiying<gaihuiying1@huawei.com> - 2.1.15-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix build error because gettext update to 0.21
|
||||
|
||||
* Wed Jul 22 2020 gaihuiying <gaihuiying1@huawei.com> - 2.11.15-1
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
|
||||
44
skip-brtfs-raid-test-if-no-support.patch
Normal file
44
skip-brtfs-raid-test-if-no-support.patch
Normal file
@ -0,0 +1,44 @@
|
||||
From 0286e1f0c2a1986c323b9c6a68dc6e106dcebd26 Mon Sep 17 00:00:00 2001
|
||||
From: zhouyihang <zhouyihang3@h-partners.com>
|
||||
Date: Thu, 28 Sep 2023 11:14:18 +0800
|
||||
Subject: [PATCH] skip brtfs raid test if no support
|
||||
|
||||
---
|
||||
tests/blivetgui_tests/add_dialog_test.py | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/tests/blivetgui_tests/add_dialog_test.py b/tests/blivetgui_tests/add_dialog_test.py
|
||||
index 93d89ec..dd9ff09 100644
|
||||
--- a/tests/blivetgui_tests/add_dialog_test.py
|
||||
+++ b/tests/blivetgui_tests/add_dialog_test.py
|
||||
@@ -10,6 +10,7 @@ import os
|
||||
|
||||
from blivet.size import Size
|
||||
from blivet import formats
|
||||
+from blivet import devicefactory
|
||||
from blivet.devicelibs import raid
|
||||
|
||||
|
||||
@@ -349,6 +350,9 @@ class AddDialogTest(unittest.TestCase):
|
||||
self.assertTrue(add_dialog.size_area.get_sensitive())
|
||||
|
||||
def test_btrfsvolume_widgets(self):
|
||||
+ btrfs_raid_level=devicefactory.get_supported_raid_levels(devicefactory.DEVICE_TYPE_BTRFS)
|
||||
+ if not len(btrfs_raid_level):
|
||||
+ self.skipTest("No supported raid level of btrfs found")
|
||||
parent_device = self._get_parent_device()
|
||||
free_device = self._get_free_device(parent=parent_device)
|
||||
|
||||
@@ -760,6 +764,9 @@ class AddDialogTest(unittest.TestCase):
|
||||
self.assertEqual(selection.raid_level, raidtype)
|
||||
|
||||
def test_btrfs_selection(self):
|
||||
+ btrfs_raid_level=devicefactory.get_supported_raid_levels(devicefactory.DEVICE_TYPE_BTRFS)
|
||||
+ if not len(btrfs_raid_level):
|
||||
+ self.skipTest("No supported raid level of btrfs found")
|
||||
parent_device = self._get_parent_device()
|
||||
free_device = self._get_free_device(parent=parent_device, size=Size("8 GiB"), is_free_region=False,
|
||||
is_empty_disk=True)
|
||||
--
|
||||
2.27.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user