Update bmc/redfishtool for Bullseye
Aligned the package layout with the concurrent Debian packaging conventions. Moved package files under 'debian/all/' to avoid duplication across OS builds and removed legacy paths under 'debian/'. Updated related build references to ensure compatibility across all supported OS codenames. Test Plan: PASS master bullseye build Story: 2011360 Task: 53332 Change-Id: Ib0960cc7e22303bd6f9b2dbcecc063981ae2c5f2 Signed-off-by: Abhinav Ayyapasetti <ayyapasetti.abhinav@windriver.com>
This commit is contained in:
committed by
Ayyapasetti Abhinav
parent
2fb5205a92
commit
be9cebc26b
@@ -1,5 +0,0 @@
|
||||
redfishtool (1.1.8-1) unstable; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- Eric Macdonald <eric.macdonald@windriver.com> Wed, 10 Apr 2024 16:12:19 +0000
|
||||
@@ -1,19 +0,0 @@
|
||||
Source: redfishtool
|
||||
Section: admin
|
||||
Priority: optional
|
||||
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
|
||||
Build-Depends: debhelper-compat (= 13),
|
||||
dh-python,
|
||||
python3-all,
|
||||
python3-setuptools,
|
||||
python3-wheel,
|
||||
Standards-Version: 4.1.2
|
||||
Homepage: https://www.starlingx.io
|
||||
|
||||
Package: redfishtool
|
||||
Architecture: all
|
||||
Depends: ${python3:Depends}, ${misc:Depends},
|
||||
Description: Access BMC Redfish service
|
||||
Provides command line interface to Board Management Controllers
|
||||
that support the Redfish protocol.
|
||||
This is the python3 version of the package.
|
||||
@@ -1,34 +0,0 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
|
||||
Files: *
|
||||
Copyright:
|
||||
(c) 2024 Wind River Systems, Inc
|
||||
(c) Copyright (c) 2016, Contributing Member(s) of Distributed Management Task Force, Inc.. All rights reserved.
|
||||
License: BSD-3-clause
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
.
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
.
|
||||
* Neither the name of Kitware, Inc. nor the names of Contributors
|
||||
may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
usr/bin/redfishtool
|
||||
usr/bin/redfishtool.py
|
||||
usr/lib/python3/dist-packages/redfishtoollib/*
|
||||
etc/redfishtool/redfishtool.ini
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
export PYBUILD_NAME=redfishtool
|
||||
|
||||
export PBR_VERSION=1.0.0
|
||||
|
||||
%:
|
||||
dh $@ --with python3 --buildsystem=pybuild
|
||||
|
||||
override_dh_install:
|
||||
mkdir -p $(CURDIR)/debian/redfishtool/etc/redfishtool
|
||||
cp $(CURDIR)/redfishtool.ini $(CURDIR)/debian/redfishtool/etc/redfishtool
|
||||
@@ -1 +0,0 @@
|
||||
3.0 (quilt)
|
||||
@@ -1,18 +0,0 @@
|
||||
[setBootOverride_overrides]
|
||||
|
||||
# The following list of server models should not receive a
|
||||
# BootSourceOverrideMode key:value pair in the
|
||||
# 'setBootOverride Once' PATCH request. When present:
|
||||
# - HP Proliant servers fail the request.
|
||||
# - Dell PowerEdge R7xxx servers initiate a BIOS reconfig update/reboot
|
||||
|
||||
# For specific servers - first filter
|
||||
exclude_BootSourceOverrideMode_Models = "R740XD vSAN Ready Node", "PowerEdge R750"
|
||||
|
||||
# For entire manufacturers - second filter
|
||||
exclude_BootSourceOverrideMode_Manufacturers = "HPE", "Dell Inc."
|
||||
|
||||
# For specific servers
|
||||
patch_setBootOverrideUrl_Models = "PowerEdge XR8720t"
|
||||
|
||||
[Settings]
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
debname: redfishtool
|
||||
debver: 1.1.8
|
||||
dl_path:
|
||||
name: 1.1.8.tar.gz
|
||||
url: https://github.com/DMTF/Redfishtool/archive/refs/tags/1.1.8.tar.gz
|
||||
md5sum: bb2769e2c0aaff1d006a97b55b40dcd9
|
||||
sha256sum: 8289dc4368f5406d9fd15dba1f7a849e994dd1e77faa7ec8b94f7defc221f8f9
|
||||
revision:
|
||||
dist: $STX_DIST
|
||||
PKG_GITREVCOUNT: true
|
||||
@@ -1,56 +0,0 @@
|
||||
From ff18b735189bcab5d7c86186fa36baabebe55971 Mon Sep 17 00:00:00 2001
|
||||
From: GitHub Release Workflow <>
|
||||
Date: Wed, 16 Aug 2023 20:28:08 +0000
|
||||
Subject: [PATCH] 1.1.8 versioning
|
||||
|
||||
Signed-off-by: GitHub Release Workflow <>
|
||||
---
|
||||
CHANGELOG.md | 3 +++
|
||||
redfishtoollib/redfishtoolTransport.py | 4 ++--
|
||||
setup.py | 2 +-
|
||||
3 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/CHANGELOG.md b/CHANGELOG.md
|
||||
index b81e357..29e6b23 100644
|
||||
--- a/CHANGELOG.md
|
||||
+++ b/CHANGELOG.md
|
||||
@@ -1,5 +1,8 @@
|
||||
# Change Log
|
||||
|
||||
+## [1.1.8] - 2023-08-16
|
||||
+- Corrected matching logic to return the matched resource if found
|
||||
+
|
||||
## [1.1.7] - 2023-06-30
|
||||
- Added workaround to specify the 'BootSourceOverrideMode' property when modifying the boot override properties even if the mode is not changing
|
||||
|
||||
diff --git a/redfishtoollib/redfishtoolTransport.py b/redfishtoollib/redfishtoolTransport.py
|
||||
index be7b83d..3eee1c7 100644
|
||||
--- a/redfishtoollib/redfishtoolTransport.py
|
||||
+++ b/redfishtoollib/redfishtoolTransport.py
|
||||
@@ -60,8 +60,8 @@ class RfTransport():
|
||||
def __init__(self):
|
||||
# constant parameters-- these dont change and are not updated
|
||||
self.program="redfishtool" # program name (in case we want to change it)
|
||||
- self.version="1.1.7" # this redfishtool version
|
||||
- self.releaseDate="06/30/2023" # release date for this version of redfishtool
|
||||
+ self.version="1.1.8" # this redfishtool version
|
||||
+ self.releaseDate="08/16/2023" # release date for this version of redfishtool
|
||||
self.downloadFrom="https://github.com/DMTF/Redfishtool" # where to find redfishtool
|
||||
self.magic="12345" # used for debug to test for a known parameter in this object
|
||||
self.UNAUTHENTICATED_API=1 # unauthenticated API that doesn't send credentials in body data
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 907c25f..c21fbbe 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -6,7 +6,7 @@ with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
setup(name='redfishtool',
|
||||
- version='1.1.7',
|
||||
+ version='1.1.8',
|
||||
description='Redfishtool package and command-line client',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
From: Eric Macdonald <eric.macdonald@windriver.com>
|
||||
Date: Sun, 15 Dec 2024 22:41:27 +0000
|
||||
Subject: Add config file based BootSourceOverrideMode handling to
|
||||
setBootOveride
|
||||
|
||||
This patch reads /etc/redfishtool/redfishtool.ini config file in
|
||||
search for the setBootOverride_overrides section that has a
|
||||
list of manufacturers and models that should not receive the
|
||||
BootSourceOverrideMode key:value pair as part of the payload
|
||||
to the 'setBootOverride Once <target>' patch request.
|
||||
|
||||
[setBootOverride_overrides]
|
||||
exclude_BootSourceOverrideMode_Models = "<model>", "<model>"
|
||||
exclude_BootSourceOverrideMode_Manufacturers = "<manufacturer>"
|
||||
|
||||
If current server is found in either the models or manufacturers lists
|
||||
then it is excluded from getting the BootSourceOverrideMode key:value
|
||||
pair added to the 'setBootOverride Once <target>' patch request.
|
||||
|
||||
Signed-off-by: Eric Macdonald <eric.macdonald@windriver.com>
|
||||
---
|
||||
redfishtoollib/Systems.py | 78 ++++++++++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 73 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/redfishtoollib/Systems.py b/redfishtoollib/Systems.py
|
||||
index a0be4ad..6abee66 100644
|
||||
--- a/redfishtoollib/Systems.py
|
||||
+++ b/redfishtoollib/Systems.py
|
||||
@@ -503,6 +503,65 @@ class RfSystemsOperations():
|
||||
return op.iterate_op(op.setIndicatorLed_single, sc, op, rft, cmdTop=cmdTop, prop=prop)
|
||||
|
||||
|
||||
+ def get_exclude_BootSourceOverrideMode(self, rft, d):
|
||||
+ """
|
||||
+ Query redfishtool.ini for models or manufacturers that should not
|
||||
+ not have the BootSourceOverrideMode key:value pair added to the
|
||||
+ setBootOverride patch request.
|
||||
+ """
|
||||
+
|
||||
+ # include the config file parser
|
||||
+ import configparser
|
||||
+
|
||||
+ manufacturer=d["Manufacturer"]
|
||||
+ model=d["Model"]
|
||||
+ rft.printVerbose(4, "Manufacturer: {}".format(d["Manufacturer"]))
|
||||
+ rft.printVerbose(4, "Model : {}".format(d["Model"]))
|
||||
+
|
||||
+ # the config file path
|
||||
+ config_file="/etc/redfishtool/redfishtool.ini"
|
||||
+ config = configparser.ConfigParser()
|
||||
+ # read the configuration file
|
||||
+ files_read = config.read(config_file)
|
||||
+ if not files_read:
|
||||
+ rft.printVerbose(0, "Configuration file '{}' not found or could not be read.".format(config_file))
|
||||
+ return(False)
|
||||
+
|
||||
+ section="setBootOverride_overrides"
|
||||
+ exclude_BootSourceOverrideMode_Models="exclude_BootSourceOverrideMode_Models"
|
||||
+ exclude_BootSourceOverrideMode_Manufacturers="exclude_BootSourceOverrideMode_Manufacturers"
|
||||
+
|
||||
+ # get the model and manufacturers exclude lists
|
||||
+ exclude_models_list=[]
|
||||
+ exclude_manufacturers_list=[]
|
||||
+ exclude_BootSourceOverrideMode=False
|
||||
+
|
||||
+ # don't fail based on missing file. Just run with default behavior.
|
||||
+ if section in config:
|
||||
+ if exclude_BootSourceOverrideMode_Models not in config[section]:
|
||||
+ rft.printVerbose(4, "Option '{}' not found in section '{}' of the configuration file {}."\
|
||||
+ .format(exclude_BootSourceOverrideMode_Models, section, config_file))
|
||||
+ else:
|
||||
+ exclude_models_list = config[section][exclude_BootSourceOverrideMode_Models]
|
||||
+ rft.printVerbose(4, "Models Exclude List: {}".format(exclude_models_list))
|
||||
+
|
||||
+ if exclude_BootSourceOverrideMode_Manufacturers not in config[section]:
|
||||
+ rft.printVerbose(4, "Option '{}' not found in section '{}' of the configuration file {}."\
|
||||
+ .format(exclude_BootSourceOverrideMode_Manufacturers, section, config_file))
|
||||
+ else:
|
||||
+ exclude_manufacturers_list = config[section][exclude_BootSourceOverrideMode_Manufacturers]
|
||||
+ rft.printVerbose(4, "Manufacturer Exclude List: {}".format(exclude_manufacturers_list))
|
||||
+
|
||||
+ exclude_BootSourceOverrideMode=False
|
||||
+ if model in exclude_models_list:
|
||||
+ rft.printVerbose(0, "Excluding BootSourceOverrideMode for server model: '{}'".format(model))
|
||||
+ exclude_BootSourceOverrideMode = True
|
||||
+ elif manufacturer in exclude_manufacturers_list:
|
||||
+ rft.printVerbose(0, "Excluding BootSourceOverrideMode for server manufacturer: '{}'".format(manufacturer))
|
||||
+ exclude_BootSourceOverrideMode = True
|
||||
+ return (exclude_BootSourceOverrideMode)
|
||||
+
|
||||
+
|
||||
def setBootOverride_single(self,sc,op,rft,cmdTop=False, prop=None):
|
||||
# this operation has argument syntaxes below:
|
||||
# ...setBootOverride <enabledVal> [<targetVal>]
|
||||
@@ -533,11 +592,17 @@ class RfSystemsOperations():
|
||||
#now read target,
|
||||
# we will need to check that the properties we are patching are there, and chk for etag hdr
|
||||
# and to see if the value specified is one of the allowable values for this rhost
|
||||
- rc,r,j,d=op.get(sc,op,rft,prop="Boot")
|
||||
+ rc,r,j,d=op.get(sc,op,rft)
|
||||
if(rc != 0):
|
||||
print("Error, can't read boot properties from remote service")
|
||||
return(8,None,False,None)
|
||||
-
|
||||
+
|
||||
+ # this call will open the redfishtool.ini file and search for server models or
|
||||
+ # manufacturers that don't support or behave well when the 'setBootOverride Once <target>'
|
||||
+ # key:value pair is part of the payload of the PATCH method.
|
||||
+ # If found then a True (to exclude) is returned.
|
||||
+ exclude_BootSourceOverrideMode = op.get_exclude_BootSourceOverrideMode(rft, d)
|
||||
+
|
||||
# verify that they have a BootSourceOverrideEnabled prop
|
||||
bootRes=d["Boot"]
|
||||
if( not "BootSourceOverrideEnabled" in bootRes ):
|
||||
@@ -587,10 +652,13 @@ class RfSystemsOperations():
|
||||
|
||||
# Get the value of "BootSourceOverrideTarget" property and pass it in the patch request.
|
||||
# Some HW vendors need this property to be passed explicitly.
|
||||
- if "BootSourceOverrideMode" in d["Boot"]:
|
||||
- patchData={"Boot": {"BootSourceOverrideEnabled": enabledVal, "BootSourceOverrideTarget": targetVal, "BootSourceOverrideMode": d["Boot"]["BootSourceOverrideMode"] } }
|
||||
+ if exclude_BootSourceOverrideMode is True:
|
||||
+ patchData={"Boot": {"BootSourceOverrideEnabled": enabledVal,\
|
||||
+ "BootSourceOverrideTarget": targetVal } }
|
||||
else:
|
||||
- patchData={"Boot": {"BootSourceOverrideEnabled": enabledVal, "BootSourceOverrideTarget": targetVal } }
|
||||
+ patchData={"Boot": {"BootSourceOverrideEnabled": enabledVal,\
|
||||
+ "BootSourceOverrideTarget": targetVal,\
|
||||
+ "BootSourceOverrideMode": d["Boot"]["BootSourceOverrideMode"] } }
|
||||
|
||||
#call the generic patch command to send the patch. This takes care of etag support
|
||||
rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
@@ -1,148 +0,0 @@
|
||||
From: Eric Macdonald <eric.macdonald@windriver.com>
|
||||
Date: Mon, 22 Sep 2025 00:45:11 +0000
|
||||
Subject: Add config file based setBootOverride Url handling named server
|
||||
models
|
||||
|
||||
This patch reads /etc/redfishtool/redfishtool.ini config file in
|
||||
search for the setBootOverride_overrides section that has a
|
||||
list of server models that require setBootOverride payload to be
|
||||
patched to the Systems Settings URL.
|
||||
|
||||
This update performs the server model detection and patch URL override.
|
||||
|
||||
[setBootOverride_overrides]
|
||||
patch_setBootOverrideUrl_Models = "<model>", "<model>"
|
||||
|
||||
Signed-off-by: Eric Macdonald <eric.macdonald@windriver.com>
|
||||
---
|
||||
redfishtoollib/Systems.py | 88 +++++++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 81 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/redfishtoollib/Systems.py b/redfishtoollib/Systems.py
|
||||
index 6abee66..8daa792 100644
|
||||
--- a/redfishtoollib/Systems.py
|
||||
+++ b/redfishtoollib/Systems.py
|
||||
@@ -502,6 +502,42 @@ class RfSystemsOperations():
|
||||
def setIndicatorLed(self, sc, op, rft, cmdTop=False, prop=None):
|
||||
return op.iterate_op(op.setIndicatorLed_single, sc, op, rft, cmdTop=cmdTop, prop=prop)
|
||||
|
||||
+ def get_patch_SetBootOverrideUrl(self, rft, d):
|
||||
+ """
|
||||
+ Query redfishtool.ini for models that need the setBootOverride to be patched
|
||||
+ through a Systems Setting URL rather than the normal default Systems URL.
|
||||
+
|
||||
+ Use the 'setBootOverride_overrides' config label and load the list of
|
||||
+ affected server models from patch_setBootOverrideUrl_Models.
|
||||
+
|
||||
+ Servers in the patch_setBootOverrideUrl_Models list must get the setBootOverride
|
||||
+ settings patched through /redfish/v1/Systems/<ComputerSystemId>/Settings
|
||||
+ instead of /redfish/v1/Systems/<ComputerSystemId>
|
||||
+ """
|
||||
+
|
||||
+ # include the config file parser
|
||||
+ import configparser
|
||||
+
|
||||
+ # the config file path
|
||||
+ config_file="/etc/redfishtool/redfishtool.ini"
|
||||
+ config = configparser.ConfigParser()
|
||||
+ # read the configuration file
|
||||
+ files_read = config.read(config_file)
|
||||
+ if not files_read:
|
||||
+ rft.printVerbose(0, "Configuration file '{}' not found or could not be read.".format(config_file))
|
||||
+ return(False)
|
||||
+
|
||||
+ patch_url_override_models_list = []
|
||||
+ section="setBootOverride_overrides"
|
||||
+ patch_setBootOverrideUrl_Models="patch_setBootOverrideUrl_Models"
|
||||
+ if section in config:
|
||||
+ patch_url_override_models_list = config[section][patch_setBootOverrideUrl_Models]
|
||||
+ model=d["Model"]
|
||||
+ if model in patch_url_override_models_list:
|
||||
+ rft.printVerbose(0, "Using System Settings URL for setBootOverride "
|
||||
+ "for server: '{}'".format(model))
|
||||
+ return True
|
||||
+ return False
|
||||
|
||||
def get_exclude_BootSourceOverrideMode(self, rft, d):
|
||||
"""
|
||||
@@ -597,6 +633,13 @@ class RfSystemsOperations():
|
||||
print("Error, can't read boot properties from remote service")
|
||||
return(8,None,False,None)
|
||||
|
||||
+ # this call will open the redfishtool.ini file and search for server models
|
||||
+ # that must patch setBootOverride payload to the Systems Settings URL.
|
||||
+ # override: /redfish/v1/Systems/<ComputerSystemId>
|
||||
+ # with: /redfish/v1/Systems/<ComputerSystemId>/Settings
|
||||
+ # If found then a True (to overrride) is returned.
|
||||
+ patch_SetBootOverrideUrl_override = op.get_patch_SetBootOverrideUrl(rft, d)
|
||||
+
|
||||
# this call will open the redfishtool.ini file and search for server models or
|
||||
# manufacturers that don't support or behave well when the 'setBootOverride Once <target>'
|
||||
# key:value pair is part of the payload of the PATCH method.
|
||||
@@ -642,12 +685,12 @@ class RfSystemsOperations():
|
||||
else:
|
||||
rft.printErr("Error, the remote service does not have a Boot prop")
|
||||
return (8, None, False, None)
|
||||
-
|
||||
+
|
||||
# verify that they have a BootSourceOverrideEnabled and BootSourceOverrideTarget prop
|
||||
if( not "BootSourceOverrideTarget" in bootRes ):
|
||||
rft.printErr("Error, the service does not have oneOf BootSourceOverride..Enabled or ..Target property")
|
||||
return(8,None,False,None)
|
||||
-
|
||||
+
|
||||
#form the patch data
|
||||
|
||||
# Get the value of "BootSourceOverrideTarget" property and pass it in the patch request.
|
||||
@@ -660,15 +703,46 @@ class RfSystemsOperations():
|
||||
"BootSourceOverrideTarget": targetVal,\
|
||||
"BootSourceOverrideMode": d["Boot"]["BootSourceOverrideMode"] } }
|
||||
|
||||
- #call the generic patch command to send the patch. This takes care of etag support
|
||||
- rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
-
|
||||
-
|
||||
+ rft.printVerbose(4,"Patch payload :{}".format(json.dumps(d,indent=4)))
|
||||
+ # Get the Settings URI from /redfish/v1/Systems/<ComputerSystemId>
|
||||
+ # In response look for:
|
||||
+ # "@Redfish.Settings": {
|
||||
+ # "SettingsObject": {
|
||||
+ # "@odata.id": "/redfish/v1/Systems/<ComputerSystemId>/Settings"
|
||||
+ # },
|
||||
+ # "SupportedApplyTimes": [
|
||||
+ # "OnReset"
|
||||
+ # ],
|
||||
+ # "@odata.type": "#Settings.v1_4_0.Settings"
|
||||
+ # },
|
||||
+ settings_uri=d["@Redfish.Settings"]["SettingsObject"]["@odata.id"]
|
||||
+ rft.printVerbose(1,"Systems Settings Patch uri:{} url:{}".format(settings_uri, r.url))
|
||||
+ if patch_SetBootOverrideUrl_override is True and settings_uri:
|
||||
+
|
||||
+ # Perform a HEAD operation to the override Settings URL to learn
|
||||
+ # the System Settings request Etag for use ion the rftSendRecvRequest
|
||||
+ settings_url = urljoin(r.url, settings_uri)
|
||||
+ rft.printVerbose(4,"Systems Settings uri:{}".format(settings_uri))
|
||||
+ rft.printVerbose(1,"Systems Settings url:{}".format(settings_url))
|
||||
+ rc, r, j, d = rft.rftSendRecvRequest(rft.AUTHENTICATED_API, "HEAD", settings_url)
|
||||
+ if rc:
|
||||
+ rft.printErr(f"Error: SendRecvRequest HEAD to "
|
||||
+ f"{settings_url} ; "
|
||||
+ f"Response: rc={rc}, type(r)={type(r)}, "
|
||||
+ f"status={getattr(r,'status_code',None)}, "
|
||||
+ f"url={getattr(r,'url',None)}")
|
||||
+ else:
|
||||
+ rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
+ rft.printVerbose(4,"Patch Settings Response Data :{}".format(json.dumps(d,indent=4)))
|
||||
+ else:
|
||||
+ #call the generic patch command to send the patch. This takes care of etag support
|
||||
+ rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
+
|
||||
if(rc==0):
|
||||
rft.printVerbose(1," Systems setBootOverride:",skip1=True, printV12=cmdTop)
|
||||
bootd={"Boot": d["Boot"]}
|
||||
return(rc,r,j,bootd)
|
||||
-
|
||||
+
|
||||
else: return(rc,r,False,None)
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
From: Eric Macdonald <eric.macdonald@windriver.com>
|
||||
Date: Wed, 15 Oct 2025 10:57:57 -0400
|
||||
Subject: Move settings object get to
|
||||
patch_SetBootOverrideUrl_override-handling
|
||||
|
||||
The 0003-Add-config-file-based-setBootOverride-Url-handling-n.patch
|
||||
introduced special setBootOverride handling for specific server
|
||||
models. That patch tries to get a @Redish.Settings" key/value pair that
|
||||
does not exist with some older servers such as the HPE Proliant DL360.
|
||||
|
||||
This patch moves the offending @Redish.Settings" key/value pair get
|
||||
into the recently added patch_SetBootOverrideUrl_override condition
|
||||
and adds some more graceful failure handling around getting the
|
||||
Redfish settings.
|
||||
|
||||
Signed-off-by: Eric Macdonald <eric.macdonald@windriver.com>
|
||||
---
|
||||
redfishtoollib/Systems.py | 69 ++++++++++++++++++++++++++---------------------
|
||||
1 file changed, 39 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/redfishtoollib/Systems.py b/redfishtoollib/Systems.py
|
||||
index 8daa792..22dbf4c 100644
|
||||
--- a/redfishtoollib/Systems.py
|
||||
+++ b/redfishtoollib/Systems.py
|
||||
@@ -703,37 +703,46 @@ class RfSystemsOperations():
|
||||
"BootSourceOverrideTarget": targetVal,\
|
||||
"BootSourceOverrideMode": d["Boot"]["BootSourceOverrideMode"] } }
|
||||
|
||||
- rft.printVerbose(4,"Patch payload :{}".format(json.dumps(d,indent=4)))
|
||||
- # Get the Settings URI from /redfish/v1/Systems/<ComputerSystemId>
|
||||
- # In response look for:
|
||||
- # "@Redfish.Settings": {
|
||||
- # "SettingsObject": {
|
||||
- # "@odata.id": "/redfish/v1/Systems/<ComputerSystemId>/Settings"
|
||||
- # },
|
||||
- # "SupportedApplyTimes": [
|
||||
- # "OnReset"
|
||||
- # ],
|
||||
- # "@odata.type": "#Settings.v1_4_0.Settings"
|
||||
- # },
|
||||
- settings_uri=d["@Redfish.Settings"]["SettingsObject"]["@odata.id"]
|
||||
- rft.printVerbose(1,"Systems Settings Patch uri:{} url:{}".format(settings_uri, r.url))
|
||||
- if patch_SetBootOverrideUrl_override is True and settings_uri:
|
||||
-
|
||||
- # Perform a HEAD operation to the override Settings URL to learn
|
||||
- # the System Settings request Etag for use ion the rftSendRecvRequest
|
||||
- settings_url = urljoin(r.url, settings_uri)
|
||||
- rft.printVerbose(4,"Systems Settings uri:{}".format(settings_uri))
|
||||
- rft.printVerbose(1,"Systems Settings url:{}".format(settings_url))
|
||||
- rc, r, j, d = rft.rftSendRecvRequest(rft.AUTHENTICATED_API, "HEAD", settings_url)
|
||||
- if rc:
|
||||
- rft.printErr(f"Error: SendRecvRequest HEAD to "
|
||||
- f"{settings_url} ; "
|
||||
- f"Response: rc={rc}, type(r)={type(r)}, "
|
||||
- f"status={getattr(r,'status_code',None)}, "
|
||||
- f"url={getattr(r,'url',None)}")
|
||||
+ if patch_SetBootOverrideUrl_override is True:
|
||||
+ rft.printVerbose(4,"Patch payload :{}".format(json.dumps(d,indent=4)))
|
||||
+ # Get the Settings URI from /redfish/v1/Systems/<ComputerSystemId>
|
||||
+ # In response look for:
|
||||
+ # "@Redfish.Settings": {
|
||||
+ # "SettingsObject": {
|
||||
+ # "@odata.id": "/redfish/v1/Systems/<ComputerSystemId>/Settings"
|
||||
+ # },
|
||||
+ # "SupportedApplyTimes": [
|
||||
+ # "OnReset"
|
||||
+ # ],
|
||||
+ # "@odata.type": "#Settings.v1_4_0.Settings"
|
||||
+ # },
|
||||
+ try:
|
||||
+ settings_uri=d["@Redfish.Settings"]["SettingsObject"]["@odata.id"]
|
||||
+ rft.printVerbose(1,"Systems Settings Patch uri:{} url:{}".format(settings_uri, r.url))
|
||||
+ except:
|
||||
+ rft.printErr("Error, failed to get @Redfish.Settings object from {}".format(r.url))
|
||||
+ return(8,None,False,None)
|
||||
+
|
||||
+ if settings_uri:
|
||||
+ rft.printVerbose(4,"Systems Settings uri from {}".format(r.url))
|
||||
+
|
||||
+ # Perform a HEAD operation to the override Settings URL to learn
|
||||
+ # the System Settings request Etag for use ion the rftSendRecvRequest
|
||||
+ settings_url = urljoin(r.url, settings_uri)
|
||||
+ rft.printVerbose(1,"Systems Settings url:{}".format(settings_url))
|
||||
+ rc, r, j, d = rft.rftSendRecvRequest(rft.AUTHENTICATED_API, "HEAD", settings_url)
|
||||
+ if rc:
|
||||
+ rft.printErr(f"Error: SendRecvRequest HEAD to "
|
||||
+ f"{settings_url} ; "
|
||||
+ f"Response: rc={rc}, type(r)={type(r)}, "
|
||||
+ f"status={getattr(r,'status_code',None)}, "
|
||||
+ f"url={getattr(r,'url',None)}")
|
||||
+ else:
|
||||
+ rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
+ rft.printVerbose(4,"Patch Settings Response Data :{}".format(json.dumps(d,indent=4)))
|
||||
else:
|
||||
- rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
- rft.printVerbose(4,"Patch Settings Response Data :{}".format(json.dumps(d,indent=4)))
|
||||
+ rft.printErr("Error, failed to get settings_uri from @Redfish.Settings object\n{}".format(d))
|
||||
+ return(8,None,False,None)
|
||||
else:
|
||||
#call the generic patch command to send the patch. This takes care of etag support
|
||||
rc,r,j,d=rft.patchResource(rft, r, patchData)
|
||||
@@ -1,4 +0,0 @@
|
||||
0001-1.1.8-versioning.patch
|
||||
0002-Add-config-file-based-BootSourceOverrideMode-handlin.patch
|
||||
0003-Add-config-file-based-setBootOverride-Url-handling-n.patch
|
||||
0004-Move-settings-object-get-to-patch_SetBootOverrideUrl.patch
|
||||
Reference in New Issue
Block a user