update blivet-gui to 2.4.0

This commit is contained in:
sherlock2010 2023-03-09 11:28:12 +00:00
parent c4000317d6
commit 52326814ca
6 changed files with 19 additions and 167 deletions

View File

@ -1,124 +0,0 @@
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()

View File

@ -1,35 +0,0 @@
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.4.0.tar.gz Normal file

Binary file not shown.

View File

@ -1,18 +1,16 @@
Name: blivet-gui
Version: 2.3.0
Release: 2
Version: 2.4.0
Release: 1
Summary: Tool for data storage configuration
License: GPLv2+
License: GPL-2.0-or-later
URL: https://github.com/storaged-project/blivet-gui
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
Source1: blivet-gui_event.conf
BuildArch: noarch
BuildRequires: desktop-file-utils libappstream-glib python3-devel gettext >= 0.18.3 python3-setuptools
BuildRequires: desktop-file-utils libappstream-glib python3-devel gettext >= 0.18.3 python3-setuptools make
Requires: python3 python3-gobject gettext python3-blivet gtk3
Requires: python3 python3-gobject polkit python3-blivet gtk3
Requires: PolicyKit-authentication-agent python3-pid libreport
Provides: %{name}-runtime
@ -35,6 +33,8 @@ Graphical (GTK) tool for manipulation and configuration of data storage
desktop-file-validate %{buildroot}/%{_datadir}/applications/blivet-gui.desktop
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/blivet-gui.appdata.xml
mkdir -p %{buildroot}/%{_sysconfdir}/libreport/events.d/
install -m644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/libreport/events.d/
install -d %{buildroot}/%{_localstatedir}/log/blivet-gui
%files
@ -57,6 +57,12 @@ install -d %{buildroot}/%{_localstatedir}/log/blivet-gui
%{_mandir}/man1/blivet-gui.1*
%changelog
* Thu Mar 09 2023 zhouyihang<zhouyihang3@h-partners.com> - 2.4.0-1
- Type:requirements
- ID:NA
- SUG:NA
- DESC:update blivet-gui to 2.4.0
* Fri May 13 2022 haomimi <haomimi@uniontech.com> - 2.3.0-2
- fix "bogus date %changelog" for spec file

5
blivet-gui_event.conf Normal file
View File

@ -0,0 +1,5 @@
EVENT=notify component=blivet-gui
# Copy log files of crashed process
cp /var/log/blivet-gui/blivet.log blivet.log
cp /var/log/blivet-gui/program.log program.log
cp /var/log/blivet-gui/blivet-gui-utils.log blivet-gui-utils.log