!9 update blivet-gui to 2.3.0

Merge pull request !9 from haochen/openEuler-22.03-LTS-Next
This commit is contained in:
openeuler-ci-bot 2021-12-29 09:24:17 +00:00 committed by Gitee
commit e025368735
6 changed files with 171 additions and 33 deletions

View File

@ -1,28 +0,0 @@
From 0aae60b135c0f15cbbdb8b196cb3a43e1308d840 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Sat, 8 Aug 2020 21:42:20 +0200
Subject: [PATCH] Ignore fallback ITS rule warning from gettext
New gettext 0.21 started warning about this and translation canary
treats all warning as errors. But this one is really just a warning
we don't care about.
---
translation-canary/xgettext_werror.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/translation-canary/xgettext_werror.sh b/translation-canary/xgettext_werror.sh
index 36eefec..5fb32a8 100755
--- a/translation-canary/xgettext_werror.sh
+++ b/translation-canary/xgettext_werror.sh
@@ -37,7 +37,7 @@ returncode=0
xgettext_output="$(LC_MESSAGES=C xgettext "$@" 2>&1)" || returncode=$?
# Look for warnings
-if echo "$xgettext_output" | fgrep -q "warning: "; then
+if echo "$xgettext_output" | awk '/warning: / && !/fallback ITS rule/{rc=1}; END {exit !rc}'; then
returncode=1
fi
--
1.8.3.1

View 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()

View File

@ -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

Binary file not shown.

View File

@ -1,18 +1,19 @@
Name: blivet-gui
Version: 2.1.15
Release: 3
Version: 2.3.0
Release: 1
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}-1/%{name}-%{version}.tar.gz
Patch0: 0001-Ignore-fallback-ITS-rule-warning-from-gettext.patch
Patch0: backport-Do-not-allow-setting-chunk-size-for-RAID1.patch
Patch1: backport-fix-device-format-error-when-removing-a-non-existing.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
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
@ -56,6 +57,12 @@ install -d %{buildroot}/%{_localstatedir}/log/blivet-gui
%{_mandir}/man1/blivet-gui.1*
%changelog
* 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 hanzhijun <hanzhijun1@huawei.com> - 2.1.15-3
- solve source url problem