!28 Correct HBA Mode and Correct hashlib.md5-usage

From: @baiguoguo 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2024-04-16 07:32:45 +00:00 committed by Gitee
commit 6cea52dd67
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,41 @@
From b49d3f24c6916e7954869bc159eac4861c67f9b0 Mon Sep 17 00:00:00 2001
From: tasleson tasleson@redhat.com
Date: Tue, 2 Apr 2024 16:21:03 +0800
Subject: [PATCH] Correct HBA-Mode and Correct hashlib.md5 usage
---
plugin/megaraid_plugin/megaraid.py | 2 +-
test/cmdtest.py.in | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugin/megaraid_plugin/megaraid.py b/plugin/megaraid_plugin/megaraid.py
index eee7233..9004262 100644
--- a/plugin/megaraid_plugin/megaraid.py
+++ b/plugin/megaraid_plugin/megaraid.py
@@ -547,7 +547,7 @@ class MegaRAID(IPlugin):
if ctrl_show_all_output["Status"]["Current Personality"] == "HBA-Mode ":
mode = System.MODE_HBA
else:
- mode = System.MODE_HBA
+ mode = System.MODE_HARDWARE_RAID
else:
mode = System.MODE_UNKNOWN
diff --git a/test/cmdtest.py.in b/test/cmdtest.py.in
index 273f07d..46d3379 100755
--- a/test/cmdtest.py.in
+++ b/test/cmdtest.py.in
@@ -65,6 +65,10 @@ def random_iqn():
s = "iqn.1994-05.com.domain:01."
m = hashlib.md5()
+ try:
+ m = hashlib.md5(usedforsecurity=False)
+ except Exception:
+ m = hashlib.md5()
u = os.uname()
for i in u:
m.update(i.encode('utf-8'))
--
2.27.0

View File

@ -2,11 +2,12 @@
%define with_python2 0
Name: libstoragemgmt
Version: 1.9.8
Release: 1
Release: 2
Summary: Storage array management library
License: LGPLv2+
URL: https://github.com/libstorage/libstoragemgmt
Source0: https://github.com/libstorage/libstoragemgmt/releases/download/%{version}/%{name}-%{version}.tar.gz
Patch1: 0001-Correct-HBA-Mode-and-Correct-hashlib.md5-usage.patch
BuildRequires: gcc gcc-c++ autoconf automake libtool libxml2-devel check-devel perl-interpreter
BuildRequires: glib2-devel systemd bash-completion libconfig-devel systemd-devel
@ -403,6 +404,9 @@ fi
%{_mandir}/man*/*
%changelog
* Tue Apr 2 2024 wulei <baiguo@kylinos.cn> - 1.9.8-2
- Correct HBA Mode and Correct hashlib.md5 usage
* Wed Oct 11 2023 wulei <wu_lei@hoperun.com> - 1.9.8-1
- Update to 1.9.8