Git Product home page Git Product logo

redfish-tacklebox's Introduction

Redfish Tacklebox

Copyright 2019-2024 DMTF. All rights reserved.

License PyPI Pulls Code style: black Linters Docker GitHub stars GitHub Contributors

About

Redfish Tacklebox contains a set of Python3 utilities to perform common management operations with a Redfish service. The utilities can be used as part of larger management applications, or be used as standalone command line tools.

Installation

pip install redfish_utilities

Building from Source

python setup.py sdist
pip install dist/redfish_utilities-x.x.x.tar.gz

Building Docker

  • Pull the container from Docker Hub:

    docker pull dmtf/redfish-tacklebox:latest
  • Build a container from local source:

    docker build -t dmtf/redfish-tacklebox:latest .
  • Build a container from GitHub:

    docker build -t dmtf/redfish-tacklebox:latest https://github.com/DMTF/Redfish-Tacklebox.git

Requirements

External modules:

You may install the external modules by running:

pip install -r requirements.txt

Utilities

Release Process

  1. Go to the "Actions" page
  2. Select the "Release and Publish" workflow
  3. Click "Run workflow"
  4. Fill out the form
  5. Click "Run workflow"

redfish-tacklebox's People

Contributors

billdodd avatar gf-mse avatar glimchb avatar honggli avatar jautor avatar jbrawdy avatar mraineri avatar peterkchen2 avatar sarahhhhfoster avatar serge-s avatar stackkorora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redfish-tacklebox's Issues

Firmware update

Hello Everyone,

I Hope your doing fine !

From the doc I have, to update the BMC firmware, it shall be like this :

curl -k -s --request POST --url [ROOT_URL] /redfish/v1/UpdateService --header 'Content-Type: application/octet-stream' --upload-file ' [FILE_PATH]'

How do I accomplish that using rf_update.py ?
Using :

rf_update.py $REDFISH_ACCESS  --target /redfish/v1/UpdateService --image ./firmware.tar

I got "Service does not support SimpleUpdate".

Thanks !
Have a nice day.
Mickaël.

Invalid options for rf_power_reset.py

$ rf_power_reset.py -u myuser -p mypass -r https://my.ip.addr --type GracefulRestart
Resetting the system...
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/redfish/bin/rf_power_reset.py", line 49, in <module>
    response = redfish_utilities.system_reset( redfish_obj, args.system, args.type )
  File "/home/user/miniconda3/envs/redfish/lib/python3.7/site-packages/redfish_utilities/systems.py", line 311, in system_reset
    verify_response( response )
  File "/home/user/miniconda3/envs/redfish/lib/python3.7/site-packages/redfish_utilities/messages.py", line 71, in verify_response
    raise RedfishOperationFailedError( "Operation failed: HTTP {}\n{}".format( response.status, exception_string ) )
redfish_utilities.messages.RedfishOperationFailedError: Operation failed: HTTP 400
A general error has occurred. See ExtendedInfo for more information.
The value GracefulRestart for the property ResetType is not in the list of acceptable values.

The -help lists nine options: {On,ForceOff,GracefulShutdown,GracefulRestart,ForceRestart,Nmi,ForceOn,PushPowerButton,PowerCycle}

But, the spec lists twelve options adding Suspend, Pause, and Resume.
https://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/ResetType

However, my system only lists seven: {On,ForceOff,GracefulShutdown,ForceRestart,Nmi,ForceOn,PushPowerButton}

Perhaps when a type is called and fails, the system is checked for the list of acceptable values to return to the user.

Support alternative methods of supplying passwords

First off, thanks for the redfish_utilities library. It’s a great resource for seeing how you guys intend for the service to be consumed.

My one suggestion is that you allow alternative methods of passing passwords to the example scripts, preferably via a file, env var, or even interactively/stdin (bonus points for all three). My biggest pet peeve with tools like Lenovo’s OneCLI is the lack of support for passing passwords in a way that doesn’t leak them in plaintext to anyone that can run ps. Ipmitool supports both interactive and passing via a file, and Lenovo/IBM at least used to support the file-based approach with ASU before they managed to regress with OneCLI.

I’d be happy to work on a PR when I get some time if it’s something you’d be willing to support.

rf_boot_override.py FutureState URI(/redfish/v1/Systems/Self/SD)

Dear Authors,

When attempting to change next boot device using rf_boot_override.py on a new ASRock motherboard we get this error:

rf_boot_override.py --user admin --password XXXXXXX --rhost fmg39-idrac --target Pxe
/usr/local/lib/python3.6/site-packages/redfish/rest/v1.py:1163: UserWarning: Scheme not specified for 'fmg39-idrac'; adding 'https://'
warnings.warn("Scheme not specified for '{}'; adding 'https://'".format(base_url))
Setting a one time boot for Pxe...
Operation failed: HTTP 400

Support of this Operation for Boot Properties is moved to FutureState URI(/redfish/v1/Systems/Self/SD)
Ami.1.0.OperationSupportedInFutureStateURI

Debug output:
rf_boot_override-2024-04-05-130912.log

Contents of /redfish/v1/Systems/Self/SD
curl -k -u admin:XXXXXXX https://fmg39-idrac:/redfish/v1/Systems/Self/SD -H "content-type:application/json" -X GET > SD.json
SD.json

Other details:
ASRock WRX80 Creator R2.0 motherboard
BMC Firmware Version 1.04.00
BIOS Firmware Version 4.02

Many thanks

Jake

Boot Override documentation

https://github.com/DMTF/Redfish-Tacklebox/blob/master/README.md

Boot Override section says:

--target TARGET, -t TARGET
The target boot device; if not provided the tool will
display the current boot settings

$ rf_boot_override.py -u myuser -p mypass -r https://my.ip.addr -t
usage: rf_boot_override.py [-h] --user USER --password PASSWORD --rhost RHOST
                           [--system SYSTEM] [--info] [--target TARGET]
                           [--uefi UEFI] [--mode MODE] [--reset]
rf_boot_override.py: error: argument --target/-t: expected one argument

I was expecting it to display the current boot settings, not tell me I need an argument. :-)

RFE: Get the power state of ComputerSystems/Chassis

Hi,

It would be great if Redfish-Tacklebox would provide a way to get the power state of a ComputerSystem/Chassis
(similar to 'chassis power status' in a well-known other tool and protocol).

This is a common use case to help users to verify the power state before and after reset commands.

Thanks for considering!
Arne

Research "Good" default timeouts

Recent additions start specifying timeouts to apply either on a specific request or in general at the script entry point.

  • rf_logs.py specifies a timeout of 30 when instantiating the Redfish object
  • All other scripts specify a timeout of 15 when instantiating the Redfish object
  • Multipart push update applies 2 seconds per MB (determined from the file size)

Original times were a bit more strict (5 seconds for all scripts, and approximately 1 second for every 3 MB for a push update).

15 seconds could be a bit aggressive for most usage and we could likely bring this back down to 5 seconds. However, the log entry reading could easily go past this in some cases, so maybe we could push the 30 seconds down to the log entry retrieval itself.

I don't have a good sense of a "right" answer for the multipart update one; file sizes can be large, and should we penalize fast networks for being accommodating of slower networks? Is there a better solution? In Ansible, a user has to specify the timeout, but I prefer to avoid adding more options.

rf_boot_override.py comamnd throws 500 internal error if one of our machine is in OFF state

rf_boot_override.py command throws 500 internal error if one of our machine is in OFF state.If its in ON state then no 500 internal error is seen.

Note:
Other two machines(platforms ) working fine even if its in ON/OFF state it doesnt matter.

python3 rf_boot_override.py --user uuuuuu --password pppppp --rhost https://10.x.x.x --system Partition0 -uefi UefiTarget -reset -t UefiShell

Setting a one time boot for UefiShell...
Resetting the system...
Task is Done!
Operation failed: HTTP 500
A general error has occurred. See Resolution for information on how to resolve the error, or @Message.ExtendedInfo if Resolution is not provided.
The request failed due to an internal service error. The service is still operational.

Boot object update fails

Update fails since ETag has not been set in request:

Traceback (most recent call last):
  File "one_time_boot_check.py", line 82, in <module>
    redfish_utilities.set_system_boot( redfish_obj, system_id = system, ov_target = test_path, ov_enabled = "Once" )
  File "/usr/local/lib/python3.6/site-packages/redfish_utilities/systems.py", line 94, in set_system_boot
    verify_response( response )
  File "/usr/local/lib/python3.6/site-packages/redfish_utilities/messages.py", line 71, in verify_response
    raise RedfishOperationFailedError( "Operation failed: HTTP {}\n{}".format( response.status, exception_string ) )
redfish_utilities.messages.RedfishOperationFailedError: Operation failed: HTTP 428
The request did not provide the required precondition, such as an If-Match or If-None-Match header.
The request did not provide the required precondition, such as an If-Match or If-None-Match header.

Document the enumeration values in README and tool help

There are several options in the various tools that need enumeration values to function properly. While many of the "valid" values can be discovered by the --info option, they are not obvious from the documentation. The tacklebox docs need to be free-standing and not rely on any knowledge of schema content. "Id" values will have to be obtained from the tools, but anything defined as an enumerated type in Redfish should be listed out here.

clear SEL log fail

Clear SEL log failed with body={} in logs.py in redfish_utiltiles module.

Clear the log

response = context.post( clear_uri, body = {} )
verify_response( response )
return response

The correct body is body = {"ClearType": "ClearAll"} according to spec in MegaRAC Redfish API follows DSP0266 1.7.0 Specification and Redfish Schema 2019.1.

And clear log succeed after change to code.
Please help have a check and fix this issue. Thanks very much.

Add new option in rf_logs.py to collect diagnostic data

New action has been added to collect diagnostic data. Would like an enhancement to make use of this action, and automatically download the file to the user's working directory. Example:

rf_logs.py -m BMC -l special_log -diagnosticdata Manager

Push model firmware update

It would be good to update the firmware update tool with options to perform the "push" style update. This would issue the multipart mime POST format and track the status to completion.

This is desirable to avoid having to fire up a web server.

In rf_event_service.py fetching info of SSE information fails

Logged in to our product GUI and checked the info.

rf_event_service.py -u -p -r https://x.x.x.x info
Service Info
Status: Enabled
Delivery Retry Policy: 3 attempts, 60 second intervals
Event Formats: N/A
Registries: N/A
Resource Types: N/A
Include Origin of Condition Supported: True
SSE URI: /redfish/v1/EventService/SSE
SSE Filter Parameters: Unknown/Unspecified

Subscription Info
Traceback (most recent call last):
File "/usr/local/bin/rf_event_service.py", line 53, in
redfish_utilities.print_event_subscriptions( event_subscriptions )
File "/usr/local/lib/python3.9/dist-packages/redfish_utilities/event_service.py", line 145, in print_event_subscriptions
print( subscription_line_format.format( subscription["Id"], "Destination", subscription["Destination"] ) )
KeyError: 'Destination'

Note:
Logs attached

Enhancement_request.txt

rf_event_service.py : -et/--eventtypes is not working eventhough its provided

Our Server machine supports EventTypes which is working fine using curl. But its not working from the tacklebox tool script.

rf_event_service.py --user administrator --password HPE1nnov --rhost https://x.x.x.x subscribe -dest https://y.y.y.y -et [Alert ResourceAdded ResourceRemoved ResourceUpdated StatusChange] -c 1

Operation failed: HTTP 400
A general error has occurred. See Resolution for information on how to resolve the error, or @Message.ExtendedInfo if Resolution is not provided.
The property EventTypes is a required property and must be included in the request.

Tried all these options but none of them working:
-et [Alert ResourceAdded ResourceRemoved ResourceUpdated StatusChange]
-et [Alert,ResourceAdded,ResourceRemoved,ResourceUpdated,StatusChange]
-et ["Alert" "ResourceAdded" "ResourceRemoved" "ResourceUpdated" "StatusChange"]
-et ["Alert","ResourceAdded","ResourceRemoved","ResourceUpdated","StatusChange"]
-et ["Alert"]
-et [Alert]
-et Alert
-et "Alert"

Let us know whats the problem around here.

cannot add user to lenovo servers ( ThinkSystem SR530,630,650)

Hello. i'm trying to add new user to lenovo server, but have an error:
redfish_utilities.accounts.RedfishAccountNotAddedError: Failed to add user 'test'; user may already exist or there is not enough space for the new user.
Response is:

'500
Date Fri, 03 Jul 2020 12:37:48 GMT
Content-Type application/json
Transfer-Encoding chunked
Connection keep-alive
Content-Language en
OData-Version 4.0
Cache-Control no-store
Server XCC Web Server
Strict-Transport-Security max-age=31536000; includeSubDomains

{"error":{"@Message.ExtendedInfo":[{"MessageArgs":[],"Resolution":"Resubmit the request.  If the problem persists, consider resetting the service.","MessageId":"Base.1.6.InternalError","Severity":"Critical","Message":"The request failed due to an internal service error.  The service is still operational.","@odata.type":"#Message.v1_0_8.Message"}],"code":"Base.1.6.GeneralError","message":"A general error has occurred. See ExtendedInfo for more information."}}

My command is:
rf_accounts.py --user USERID --password USERKVM00! --rhost https://10.81.4.34 --add zabbix '1qaz@WSX#EDC' Read-only

Server OS: CentOS Linux release 8.2.2004 (Core)
Python version: Python 3.6.8
redfish-utilities version: 1.0.7

How to key Protocol when create subscription with rf_event_service.py

Hi,
As far as I know Destination and Protocol are necessary to create a subscription, but I don't know how to enter the value about Protocol when creating the subscription.
Not sure if the failure to send the command is related to missing necessary parameters.
fail

Attached the request body about creating Subscription via Redfish:
{
"Context": "Event_Sub",
"Destination": "https://192.168.0.110:4443",
"Protocol": "Redfish",
"EventFormatType": "Event",
"ResourceTypes": [
"EventService",
"Systems",
"AccountService",
"TelemetryService",
"Chassis",
"Managers",
"TaskService"
],
"RegistryPrefixes": [
"EventLog",
"IPMI",
"HttpStatus",
"SyncAgent",
"Security",
"Base",
"Task"
]
}

Thanks,
Felix

rf_sys_inventory.py fails to find Baseboard

Not sure if this is a bad spec or what, but Intel has a sub-folder for Baseboard. A nicer error handling would be nice here at least but perhaps recognizing the Intel Baseboard is under RackMount would be better.

$ rf_sys_inventory.py -u myuser -p mypass -r https://my.ip.add 
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/redfish/bin/rf_sys_inventory.py", line 39, in <module>
    inventory = redfish_utilities.get_system_inventory( redfish_obj )
  File "/home/user/miniconda3/envs/redfish/lib/python3.7/site-packages/redfish_utilities/inventory.py", line 69, in get_system_inventory
    verify_response( chassis )
  File "/home/user/miniconda3/envs/redfish/lib/python3.7/site-packages/redfish_utilities/messages.py", line 71, in verify_response
    raise RedfishOperationFailedError( "Operation failed: HTTP {}\n{}".format( response.status, exception_string ) )
redfish_utilities.messages.RedfishOperationFailedError: Operation failed: HTTP 404
A general error has occurred. See ExtendedInfo for more information.
The resource at the URI /redfish/v1/Chassis/Baseboard was not found.

/redfish/v1/Chassis/ has this:

{
  "@odata.context": "/redfish/v1/$metadata#ChassisCollection.ChassisCollection",
  "@odata.id": "/redfish/v1/Chassis",
  "@odata.type": "#ChassisCollection.ChassisCollection",
  "Name": "Chassis Collection",
  "[email protected]": 9,
  "Members": [
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/Baseboard"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/HSBackplane1"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/OCPModule"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/PCIeRiser1"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/PCIeRiser2"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/AICInterposer"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/PwrSupply1FRU"
    },
    {
      "@odata.id": "/redfish/v1/Chassis/RackMount/PwrSupply2FRU"
    }
  ],
  "@odata.etag": "dd9ffd6a2c507be7fc09807cd6983d587a7f62cf3912f0d3c2d3e4ba834478f60835742d04c6d058cbd7d4c1e783ff9e19fba8bcaccbcbb771f8f3c9537edf91"
}

This is with new Intel systems.
https://www.intel.com/content/www/us/en/products/sku/214845/intel-server-system-m50cyp1ur204/specifications.html

Thanks!

Exception catch hides root cause of an error

Please see

If the Redfish service responds with an HTTP 500, verify_response will throw RedfishOperationFailedError( "Operation failed: HTTP {}\n{}" and provide the proper error response, but the enclosing catch replaces the real root cause of the failure with a false error
RedfishSystemNotFoundError( "Service does not contain a system called {}; valid systems: {}....

ModuleNotFoundError: No module named 'redfish_utilities'

Hi,
I git clone the project and try to run the scripts in cmd/powershell, it will raise ModuleNotFoundError: No module named 'redfish_utilities'
image

I don't want to use the pip install redfish_utilities way because I treat the whole project as a standalone tool, do you have any suggestions? Thank you.

Problem with rf_bios_settings.py

I'm not able to view / set any bios attributes with the command:

rf_bios_settings.py -u admin -p admin -r https://192.168.0.99 -s Self
Traceback (most recent call last):
  File "/usr/local/bin/rf_bios_settings.py", line 33, in <module>
    current_settings, future_settings = redfish_utilities.get_system_bios( redfish_obj, args.system )
  File "/usr/local/lib/python3.9/dist-packages/redfish_utilities/systems.py", line 518, in get_system_bios
    bios_settings = context.get( bios.dict["@Redfish.Settings"]["SettingsObject"]["@odata.id"] )
KeyError: 'SettingsObject'

If I use redfishtool with raw GET /redfish/v1/Systems/Self/Bios, does return all the Attributes, but is less clear on patch command etc.

Any thoughts? Thanks!

pip3 show redfish_utilities redfish
Name: redfish-utilities
Version: 1.1.4
Summary: Redfish Utilities
Home-page: https://github.com/DMTF/Redfish-Tacklebox
Author: DMTF, https://www.dmtf.org/standards/feedback
Author-email: None
License: BSD 3-clause "New" or "Revised License"
Location: /usr/local/lib/python3.9/dist-packages
Requires: redfish
Required-by:
---
Name: redfish
Version: 3.0.1
Summary: Redfish Python Library
Home-page: https://github.com/DMTF/python-redfish-library
Author: DMTF, https://www.dmtf.org/standards/feedback
Author-email: None
License: BSD 3-clause "New" or "Revised License"
Location: /usr/local/lib/python3.9/dist-packages
Requires: jsonpatch, jsonpointer, jsonpath-rw
Required-by: redfish-utilities

TransferProtocol error from rf_update.py

I got this error today, and found a similar issue in #65 but the answer seemed to just be protocol could be NONE.

If I pass in protocol = "HTTP" to the simple_update call, this error goes away. If I don't make this change I get the following:

rf_update.py -u xxxxx -p xxxxxxxxx -r https://host1 -i http://192.168.1.251/fw-updates.itb
Traceback (most recent call last):
  File "/bin/rf_update.py", line 107, in <module>
    response = redfish_utilities.simple_update( redfish_obj, image_uri, targets = targets )
  File "/usr/lib/python3.6/site-packages/redfish_utilities/update.py", line 125, in simple_update
    verify_response( response )
  File "/usr/lib/python3.6/site-packages/redfish_utilities/messages.py", line 71, in verify_response
    raise RedfishOperationFailedError( "Operation failed: HTTP {}\n{}".format( response.status, exception_string ) )
redfish_utilities.messages.RedfishOperationFailedError: Operation failed: HTTP 400
The property TransferProtocol is a required property and must be included in the request.
The property TransferProtocol is a required property and must be included in the request.

This could be a red herring, no pun intended, since I am not a redfish nor a REST expert nor python for that matter. I don't see anywhere what protocol gets set except to NONE and for me that seems to cause a failure. Should rf_update.py work out of the box for most things assuming the redfish implementation is solid? Thanks for your time and work on this project.

Clay

Still we see the same type of issue with fresh clone after the fix.

Still we see the same type of issue with fresh clone after the merge.

Logs below:

  1. When No subscription: WORKING FINE
    ===================================

rf_event_service.py -u username -p password -r https://x.x.x.x info
Service Info
Status: Enabled
Delivery Retry Policy: 3 attempts, 60 second intervals
Event Formats: N/A
Registries: N/A
Resource Types: N/A
Include Origin of Condition Supported: True
SSE URI: /redfish/v1/EventService/SSE
SSE Filter Parameters: Unknown/Unspecified

Subscription Info
No subscriptions

  1. When one subscription:WORKING FINE
    ===================================
    rf_event_service.py -u username -p password -r https://x.x.x.x subscribe -dest https://y.y.y.y/redfish_event_handler -c 2
    Created subscription '/redfish/v1/EventService/Subscriptions/c30cb7fdefeb453ca2a985935ed4ce16'

rf_event_service.py -u username -p password -r https://x.x.x.x info
Service Info
Status: Enabled
Delivery Retry Policy: 3 attempts, 60 second intervals
Event Formats: N/A
Registries: N/A
Resource Types: N/A
Include Origin of Condition Supported: True
SSE URI: /redfish/v1/EventService/SSE
SSE Filter Parameters: Unknown/Unspecified

Subscription Info
c30cb7fdefeb453ca2a985935ed4ce16 | Destination: https://y.y.y.y/redfish_event_handler
| State: Enabled
| Context: 2
| Event Format: Event

  1. when one subscription already added now open one SSE session: FAILS
    ===============================================

rf_event_service.py -u username -p password -r https://x.x.x.x info
Service Info
Status: Enabled
Delivery Retry Policy: 3 attempts, 60 second intervals
Event Formats: N/A
Registries: N/A
Resource Types: N/A
Include Origin of Condition Supported: True
SSE URI: /redfish/v1/EventService/SSE
SSE Filter Parameters: Unknown/Unspecified

Subscription Info
c30cb7fdefeb453ca2a985935ed4ce16 | Destination: https://y.y.y.y/redfish_event_handler
| State: Enabled
| Context: 2
| Event Format: Event
Traceback (most recent call last):
File "/usr/local/bin/rf_event_service.py", line 53, in
redfish_utilities.print_event_subscriptions( event_subscriptions )
File "/usr/local/lib/python3.9/dist-packages/redfish_utilities/event_service.py", line 145, in print_event_subscriptions
print( subscription_line_format.format( subscription["Id"], "Destination", subscription["Destination"] ) )
KeyError: 'Destination'

  1. Only with SSE session:FAILS
    =========================

rf_event_service.py -u username -p password -r https://x.x.x.x info
Service Info
Status: Enabled
Delivery Retry Policy: 3 attempts, 60 second intervals
Event Formats: N/A
Registries: N/A
Resource Types: N/A
Include Origin of Condition Supported: True
SSE URI: /redfish/v1/EventService/SSE
SSE Filter Parameters: Unknown/Unspecified

Subscription Info
Traceback (most recent call last):
File "/usr/local/bin/rf_event_service.py", line 53, in
redfish_utilities.print_event_subscriptions( event_subscriptions )
File "/usr/local/lib/python3.9/dist-packages/redfish_utilities/event_service.py", line 145, in print_event_subscriptions
print( subscription_line_format.format( subscription["Id"], "Destination", subscription["Destination"] ) )
KeyError: 'Destination'

Originally posted by @rajeshkumarmhpe in #59 (comment)

Tool to manage BIOS settings

Would like a tool to view/change BIOS settings.

rf_bios_settings -u <user> -p <password> -r <rhost> -s <system> -a <attribute> -v <value>

The -u, -p, and -r arguments are the same as other tools (and all required).
The -s argument will target a specified system. If this parameter is not provided, then check to see if the service has exactly one member in its system collection; if it does, then use that member (error otherwise)
-a and -v are used together to apply a change to an attribute. If they are not provided, then just display the current content of the BIOS resource as a table.

The tool will need to check if there is an @Redfish.Settings object in the BIOS resource; if present, then the operations would be done on the Settings resource rather than the BIOS resource itself.

Fix ruff lint errors

Now that CI runs ruff check, we can start fixing lint errors

see

# - run: ruff check .

reported errors:

$ ruff check .
redfish_utilities/__init__.py:6:23: F401 `.accounts.get_users` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:7:23: F401 `.accounts.print_users` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:8:23: F401 `.accounts.add_user` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:9:23: F401 `.accounts.delete_user` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:10:23: F401 `.accounts.modify_user` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:11:23: F401 `.assembly.get_assembly` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:12:23: F401 `.assembly.print_assembly` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:13:23: F401 `.assembly.download_assembly` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:14:23: F401 `.assembly.upload_assembly` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:15:27: F401 `.certificates.get_all_certificates` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:16:27: F401 `.certificates.print_certificates` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:17:27: F401 `.certificates.get_generate_csr_info` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:18:27: F401 `.certificates.generate_csr` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:19:27: F401 `.certificates.install_certificate` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:20:27: F401 `.certificates.delete_certificate` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:21:28: F401 `.event_service.get_event_service` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:22:28: F401 `.event_service.print_event_service` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:23:28: F401 `.event_service.get_event_subscriptions` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:24:28: F401 `.event_service.print_event_subscriptions` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:25:28: F401 `.event_service.create_event_subscription` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:26:28: F401 `.event_service.delete_event_subscription` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:27:24: F401 `.inventory.get_system_inventory` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:28:24: F401 `.inventory.print_system_inventory` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:29:24: F401 `.inventory.write_system_inventory` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:30:23: F401 `.licenses.get_licenses` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:31:23: F401 `.licenses.print_licenses` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:32:23: F401 `.licenses.install_license` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:33:23: F401 `.licenses.delete_license` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:34:19: F401 `.logs.log_container` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:35:19: F401 `.logs.diagnostic_data_types` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:36:19: F401 `.logs.get_log_entries` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:37:19: F401 `.logs.print_log_entries` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:38:19: F401 `.logs.clear_log_entries` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:39:19: F401 `.logs.collect_diagnostic_data` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:40:19: F401 `.logs.download_diagnostic_data` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:41:23: F401 `.managers.get_manager_ids` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:42:23: F401 `.managers.get_manager` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:43:23: F401 `.managers.set_manager` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:44:23: F401 `.managers.print_manager` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:45:23: F401 `.managers.get_manager_reset_info` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:46:23: F401 `.managers.manager_reset` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:47:23: F401 `.managers.get_manager_reset_to_defaults_info` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:48:23: F401 `.managers.manager_reset_to_defaults` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:49:23: F401 `.managers.get_manager_network_protocol` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:50:23: F401 `.managers.set_manager_network_protocol` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:51:23: F401 `.managers.print_manager_network_protocol` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:52:23: F401 `.managers.get_manager_ethernet_interface_ids` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:53:23: F401 `.managers.get_manager_ethernet_interface` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:54:23: F401 `.managers.set_manager_ethernet_interface` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:55:23: F401 `.managers.print_manager_ethernet_interface` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:56:23: F401 `.messages.print_error_payload` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:57:23: F401 `.messages.verify_response` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:58:30: F401 `.power_equipment.power_equipment_types` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:59:30: F401 `.power_equipment.power_equipment_electrical_types` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:60:30: F401 `.power_equipment.get_power_equipment_ids` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:61:30: F401 `.power_equipment.get_power_equipment` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:62:30: F401 `.power_equipment.print_power_equipment` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:63:30: F401 `.power_equipment.get_power_equipment_summary` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:64:30: F401 `.power_equipment.print_power_equipment_summary` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:65:30: F401 `.power_equipment.get_power_equipment_electrical` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:66:30: F401 `.power_equipment.print_power_equipment_electrical` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:67:30: F401 `.power_equipment.print_power_equipment_electrical_summary` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:68:21: F401 `.resets.reset_types` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:69:21: F401 `.resets.reset_to_defaults_types` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:70:22: F401 `.sensors.get_sensors` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:71:22: F401 `.sensors.print_sensors` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:72:22: F401 `.systems.get_system_ids` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:73:22: F401 `.systems.get_system` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:74:22: F401 `.systems.get_system_boot` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:75:22: F401 `.systems.set_system_boot` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:76:22: F401 `.systems.print_system_boot` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:77:22: F401 `.systems.get_system_reset_info` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:78:22: F401 `.systems.system_reset` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:79:22: F401 `.systems.get_virtual_media` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:80:22: F401 `.systems.print_virtual_media` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:81:22: F401 `.systems.insert_virtual_media` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:82:22: F401 `.systems.eject_virtual_media` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:83:22: F401 `.systems.get_system_bios` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:84:22: F401 `.systems.set_system_bios` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:85:22: F401 `.systems.print_system_bios` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:86:20: F401 `.tasks.poll_task_monitor` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:87:21: F401 `.update.operation_apply_times` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:88:21: F401 `.update.get_update_service` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:89:21: F401 `.update.get_simple_update_info` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:90:21: F401 `.update.simple_update` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:91:21: F401 `.update.multipart_push_update` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/__init__.py:92:1: F403 `from .misc import *` used; unable to detect undefined names
redfish_utilities/__init__.py:94:15: F401 `.config` imported but unused; consider removing, adding to `__all__`, or using a redundant alias
redfish_utilities/accounts.py:60:47: E712 Avoid equality comparisons to `False`; use `if not account_info["Enabled"]:` for false checks
redfish_utilities/certificates.py:15:8: F401 [*] `os` imported but unused
redfish_utilities/inventory.py:45:5: E722 Do not use bare `except`
redfish_utilities/inventory.py:71:9: E722 Do not use bare `except`
redfish_utilities/inventory.py:98:13: E722 Do not use bare `except`
redfish_utilities/inventory.py:122:9: E722 Do not use bare `except`
redfish_utilities/inventory.py:216:5: E722 Do not use bare `except`
redfish_utilities/inventory.py:220:5: E722 Do not use bare `except`
redfish_utilities/messages.py:15:1: F403 `from redfish.messages import *` used; unable to detect undefined names
redfish_utilities/messages.py:26:27: F405 `get_messages_detail` may be undefined, or defined from star imports
redfish_utilities/messages.py:27:28: F405 `get_error_messages` may be undefined, or defined from star imports
redfish_utilities/messages.py:28:24: F405 `search_message` may be undefined, or defined from star imports
redfish_utilities/messages.py:29:16: E714 [*] Test for object identity should be `is not`
redfish_utilities/messages.py:30:19: F405 `RedfishPasswordChangeRequiredError` may be undefined, or defined from star imports
redfish_utilities/messages.py:32:19: F405 `RedfishOperationFailedError` may be undefined, or defined from star imports
redfish_utilities/messages.py:45:16: F405 `get_error_messages` may be undefined, or defined from star imports
redfish_utilities/messages.py:46:5: E722 Do not use bare `except`
redfish_utilities/misc.py:14:8: F401 [*] `sys` imported but unused
redfish_utilities/misc.py:28:29: F841 [*] Local variable `e` is assigned to but never used
redfish_utilities/systems.py:472:13: E722 Do not use bare `except`
redfish_utilities/systems.py:517:13: E722 Do not use bare `except`
redfish_utilities/systems.py:596:9: E722 Do not use bare `except`
redfish_utilities/systems.py:665:13: E722 Do not use bare `except`
redfish_utilities/tasks.py:44:9: E722 Do not use bare `except`
redfish_utilities/update.py:18:8: F401 [*] `math` imported but unused
scripts/rf_accounts.py:76:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_assembly.py:54:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_assembly.py:57:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_bios_settings.py:48:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_bios_settings.py:51:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_bios_settings.py:75:21: E722 Do not use bare `except`
scripts/rf_boot_override.py:59:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_boot_override.py:62:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_certificates.py:65:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_certificates.py:68:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_diagnostic_data.py:43:4: E712 Avoid inequality comparisons to `False`; use `if args.manager:` for truth checks
scripts/rf_diagnostic_data.py:46:6: E712 Avoid inequality comparisons to `False`; use `if args.system:` for truth checks
scripts/rf_diagnostic_data.py:49:6: E712 Avoid inequality comparisons to `False`; use `if args.chassis:` for truth checks
scripts/rf_diagnostic_data.py:64:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_diagnostic_data.py:67:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_discover.py:42:5: E722 Do not use bare `except`
scripts/rf_event_service.py:54:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_event_service.py:57:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_licenses.py:49:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_licenses.py:52:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_logs.py:41:4: E712 Avoid inequality comparisons to `False`; use `if args.manager:` for truth checks
scripts/rf_logs.py:44:6: E712 Avoid inequality comparisons to `False`; use `if args.system:` for truth checks
scripts/rf_logs.py:47:6: E712 Avoid inequality comparisons to `False`; use `if args.chassis:` for truth checks
scripts/rf_logs.py:62:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_logs.py:65:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_manager_config.py:74:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_manager_config.py:77:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_power_equipment.py:62:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_power_equipment.py:65:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_power_reset.py:45:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_power_reset.py:48:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_raw_request.py:20:8: F401 [*] `re` imported but unused
scripts/rf_raw_request.py:63:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_raw_request.py:66:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_raw_request.py:78:5: E722 Do not use bare `except`
scripts/rf_raw_request.py:112:5: E722 Do not use bare `except`
scripts/rf_sensor_list.py:44:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_sensor_list.py:47:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_sys_inventory.py:50:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_sys_inventory.py:53:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_update.py:49:5: E722 Do not use bare `except`
scripts/rf_update.py:76:5: E722 Do not use bare `except`
scripts/rf_update.py:105:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_update.py:108:21: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_update.py:169:5: E722 Do not use bare `except`
scripts/rf_virtual_media.py:53:46: F841 [*] Local variable `e` is assigned to but never used
scripts/rf_virtual_media.py:56:21: F841 [*] Local variable `e` is assigned to but never used
setup.py:9:8: F401 [*] `sys` imported but unused
Found 161 errors.
[*] 40 fixable with the `--fix` option (7 hidden fixes can be enabled with the `--unsafe-fixes` option).

Add RPM packages back to release

With new authentication requirements for PyPI, the newer tools to push new packages don't support RPMs used with "bdist_rpm". Removed it for now to get the release out.

Error return about rf_bios_settings

Hi,

I want to change one of the Attribute value from false to true.
bios
But after sending the command I get the response as shown:
bios_acpi004_true
I'm sure this property existed, but value not changed.
I don't understand what the response means. Could you help to explain?

Thanks,
Felix

rf_sensor_list

Traceback (most recent call last):
File "/usr/local/bin/rf_sensor_list.py", line 31, in
sensors = redfish_utilities.get_sensors( redfish_obj )
File "/usr/local/lib/python3.8/site-packages/redfish_utilities/sensors.py", line 52, in get_sensors
get_excerpt_status( chassis_instance["ChassisName"], "TemperatureCelsius", "Cel", environment.dict, chassis_instance["Readings"] )
File "/usr/local/lib/python3.8/site-packages/redfish_utilities/sensors.py", line 347, in get_excerpt_status
"Reading": object[field]["Reading"],
KeyError: 'Reading'
stderr_lines:
stdout: ''
stdout_lines:
I don't know the reason for the error. If you know, please help to check it. Thank you

Scripts do not run on Windows without providing "python " before the command

Currently the scripts rely on shebang usage to pick the proper executable that will run the script. Unfortunately Windows does not support this, and this seems to have been worked around by having the Windows installation of Python set an association with .py files with the Python executable. The scripts today do not have file extensions as an aesthetic choice.

please run `black`

pip install black
black .

and add badge

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat)](https://github.com/psf/black)

Enhance handling of PCIeDevice resources

Current inventory tool relies on the command Manufacturer, PartNumber, SerialNumber, etc properties, but there are many cases where these will not be available for PCIeDevice. Need to have fall back logic to look at other properties when building a name for the device.

rf_sensor_list.py script, does not identify the correct fan fault

Executed rf_sensor_list.py on a system with a fan fault. The script indicated tach faults across two different fan packs, although the error was within one fan pack. Used thmtest and SEL check, both of which indicated the correct fan fault. Injected fan faults by simply removing a fan to see how the error was reported. Attached error reporting.
rf_sensor_list.txt

Would like a logservice tool

Would like a tool to view logs from Logservice

rf_logs -u -p -r -s <system_id> -m <manager_id> -c

The -u, -p, and -r arguments are the same as other tools (and all required).
The -s argument will target a specified system. optional.
The -m argument will target a specified manager. optional.
The -c argument will target a specified chassis. optional.

If no optional parameter is provided => error, at least one.

I may miss options ?

Best Regards,
Francine

OSError when piping output from rf_logs.py

While doing some testing with rf_logs.py I discovered that if you pipe or redirect the output, you will get an OSError:

$ python3.8 rf_logs.py -u admin -p ******** -r https://127.0.0.5 | head -5
Traceback (most recent call last):
  File "rf_logs.py", line 61, in <module>
    redfish_utilities.print_log_entries( log_entries, args.details )
  File "~/Development/git/Redfish-Tacklebox/redfish_utilities/logs.py", line 79, in print_log_entries
    console_size = os.get_terminal_size()
OSError: [Errno 25] Inappropriate ioctl for device

Similar results for other useful commands like:

$ python3.8 rf_logs.py -u admin -p ******** -r https://127.0.0.5 > logs.out
$ python3.8 rf_logs.py -u admin -p ******** -r https://127.0.0.5 | grep unauthorized

After fixing that (by using shutil.get_terminal_size()), there was an extraneous BrokenPipeError when piping to head:

$ python3.8 rf_logs.py -u admin -p ******** -r https://127.0.0.5 | head -5
  Id    | Timestamp                 | Message
  1     | 2020-02-08T00:11:45Z      | User rfpv60c4 added by: admin.
  2     | 2020-02-08T00:11:45Z      | User rfpv60c4 deleted by: admin.
  3     | 2020-02-08T00:11:47Z      | Browser login failure from: 127.0.0.5(
  4     | 2020-02-08T00:25:32Z      | Browser login: admin - 127.0.0.5(DNS n
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>
BrokenPipeError: [Errno 32] Broken pipe

Fixed that by catching the BrokenPipeError and closing stderr just before exiting.

After those changes:

$ python3.8 rf_logs.py -u admin -p ******** -r https://127.0.0.5 | head -5
  Id    | Timestamp                 | Message
  1     | 2020-02-08T00:28:23Z      | User rfpv2ec8 added by: admin.
  2     | 2020-02-08T00:28:23Z      | User rfpv2ec8 modified by: admin.
  3     | 2020-02-08T00:28:23Z      | User rfpv2ec8 deleted by: admin.
  4     | 2020-02-08T00:28:24Z      | User rfpv7924 added by: admin.

About TransferProtocolType of SimpleUpdate in Update feature

Hi,

When I send command for Update feature:
rf_update.py -u Administrator -p superuser -r https://192.168.0.116 -i http://192.168.0.110/rom.ima_enc

Traceback (most recent call last):
File "/usr/local/bin/rf_update.py", line 107, in
response = redfish_utilities.simple_update( redfish_obj, image_uri, targets = targets )
File "/usr/local/lib/python3.8/dist-packages/redfish_utilities/update.py", line 125, in simple_update
verify_response( response )
File "/usr/local/lib/python3.8/dist-packages/redfish_utilities/messages.py", line 71, in verify_response
raise RedfishOperationFailedError( "Operation failed: HTTP {}\n{}".format( response.status, exception_string ) )
redfish_utilities.messages.RedfishOperationFailedError: Operation failed: HTTP 400
The property TransferProtocol is a required property and must be included in the request.
The property TransferProtocol is a required property and must be included in the request.

I know "TransferProtocol" is not a required parameter in SimpleUpschemas. If I want to update image with HTTP protocol, how do I add TransferProtocol property in the request? Is it possible to add a concept similar to default values?

Thanks.

rf_boot_override.py error handling

$ rf_boot_override.py -u myuser -p mypass -r https://my.ip.addr -t badoption
Setting a one time boot for badoption...
Traceback (most recent call last):
  File "/home/user/miniconda3/envs/redfish/bin/rf_boot_override.py", line 60, in <module>
    redfish_utilities.set_system_boot( redfish_obj, args.system, args.target, boot_enable, args.mode, uefi_target, boot_next )
  File "/home/user/miniconda3/envs/redfish/lib/python3.7/site-packages/redfish_utilities/systems.py", line 163, in set_system_boot
    raise ValueError( "{} is not an allowable override target ({})".format( ov_target, ", ".join( ov_target_values ) ) )
ValueError: badoption is not an allowable override target (None, Pxe, Floppy, Cd, Usb, Hdd, BiosSetup, Utilities, Diags, UefiShell, UefiTarget, SDCard, UefiHttp, RemoteDrive, UefiBootNext)

I think it would be a nicer experience to not have the excess error messages. The last line is a perfect explanation of what went wrong and what needs to change. The rest is not needed/helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.