Upgrade redfishtool to 1.1.0 version

Some patches we upstreamed for our redfish feature have already
been merged to 1.1.0 version.

Deployment test on simplex and sensor list test pass!

Story: 2005861
Task: 36276

Depends-on: https://review.opendev.org/#/c/676305/
Change-Id: Iae1d070fbcdb4b2d3306432af77e24284db4e452
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
This commit is contained in:
zhipengl 2019-08-14 19:29:04 +08:00 committed by zhipeng liu
parent ac13d8af3f
commit fe018fd3c8
3 changed files with 3 additions and 40 deletions

View File

@ -1,6 +1,6 @@
COPY_LIST=" \
$STX_BASE/downloads/Redfishtool-1.0.8.tar.gz \
$STX_BASE/downloads/Redfishtool-1.1.0.tar.gz \
$PKG_BASE/files/* \
"
TIS_PATCH_VER=0
TIS_PATCH_VER=1

View File

@ -6,7 +6,7 @@
Summary: Redfish Tool Package
Name: Redfishtool
Version: 1.0.8
Version: 1.1.0
Release: %{?_tis_dist}.%{tis_patch_ver}
#For full text see link: https://github.com/DMTF/Redfishtool/blob/master/LICENSE.md
License: BSD-3-Clause.
@ -19,7 +19,6 @@ Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
Patch01: 0001-Adapt-redfishtool-to-python2.patch
Patch02: 0002-Add-configfile-option-support.patch
BuildRequires: python-setuptools
@ -34,7 +33,6 @@ Redfish Tool Package
%prep
%setup
%patch01 -p1
%patch02 -p1
# Remove bundled egg-info
rm -rf *.egg-info

View File

@ -1,35 +0,0 @@
From d0c3cc759545a82138329e292e99f310ec74047f Mon Sep 17 00:00:00 2001
From: zhipengl <zhipengs.liu@intel.com>
Date: Sat, 22 Jun 2019 02:06:54 +0800
Subject: [PATCH] Add configfile option support
Signed-off-by: zhipengl <zhipengs.liu@intel.com>
---
redfishtool/redfishtoolMain.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/redfishtool/redfishtoolMain.py b/redfishtool/redfishtoolMain.py
index cd3dd6f..ea2e44f 100644
--- a/redfishtool/redfishtoolMain.py
+++ b/redfishtool/redfishtoolMain.py
@@ -156,6 +156,17 @@ def main(argv):
rft.authToken=rft.token
elif opt in ("-c", "--config"): #read additional options from a file
rft.configFile=arg
+ try:
+ with open(arg, 'r') as f:
+ configdata = json.load(f)
+ if 'username' in configdata and 'password' in configdata:
+ rft.user = configdata['username']
+ rft.password = configdata['password']
+ rft.printVerbose(1,"Main: get pw from configfile, usr:{}, pw:{}".format(rft.user, rft.password))
+ else:
+ rft.printErr("Invalid --config= filedata: {}".format(configdata))
+ except IOError:
+ rft.printErr("Invalid: Could not open configfile")
elif opt in ("-T", "--Timeout"): #Specify http timeout in seconds
timePattern="^([1-9][0-9]*)$"
timeMatch=re.search(timePattern,arg)
--
2.7.4