2
0
mirror of https://opendev.org/x/pyghmi synced 2026-09-26 01:34:11 +00:00
Commit Graph

120 Commits

Author SHA1 Message Date
Jarrod Johnson 79ac63f409 Refactor system configuration management to OEM
Permit OEM override of the standard redfish BIOS attribute
mechanism

Change-Id: I26e63d12ed830fb7747fc5786c0c9be955671de0
2022-10-31 15:38:08 -04:00
Jarrod Johnson 8156a63c2b Implement OEM user deletion
The redfish and ipmi standards do not provide well for standardized
user deletion consistently implemented across vendors.

Provide a hook for an OEM handler to go into vendor specific
behavior to provide a more reasonable deletion.

Change-Id: I7131edbb6dbab31d205eef664e68d721f33b4422
2022-09-27 16:14:20 -04:00
Jarrod Johnson 5f63810884 Allow virtualmedia on Systems instead of Managers
Redfish now allows a system to opt to place virtual media
on system rather than manager.  The rational being that
remote media has to be mapped to specific hosts, and the
manager relationship to that media can be implicit.

Try the system first (more specific) then fallback to traditional
manager location for virtualmedia.

Change-Id: I5d63b5e57572c6a753a2d86adb223335a15a71ea
2022-05-20 07:29:02 -04:00
Jarrod Johnson 45dc3bad83 Ignore stub log entries
Some BMCs implement entry logs that are
not actionable.  Trim those out to avoid empty data
for a user to scratch their head at.

Change-Id: I05ea62cdd3a56dfdeea4080774ec5a67a651824f
2022-05-10 08:23:21 -04:00
Jarrod Johnson 4cfaf03d6c Add iDrac virtual cd/floppy
iDRAC does not support standard
redfish boot devices, provide oem override
in such case to use the OEM interface.

Change-Id: I53d7bb1d82035e621802c20f46000760cc8631a8
2022-01-06 16:03:25 -05:00
Jarrod Johnson 51eebd39fc Update generic redfish remote media for eject/insert
Certain redfish implementation only allow manipulation
of remote media through Actions.  Detect when relevant
Actions are indicated and use them if offered.

Change-Id: I4eac9e5f4edb111f45551280fd98cdbc9c10c178
2022-01-04 11:00:57 -05:00
Jarrod Johnson 5345a466c6 Fix bmc network configuration over ipv6 client
Change-Id: I62c6f774085a863e28481918d7072faff8594c5e
2021-12-09 11:41:04 -05:00
Jarrod Johnson a36bbe96e4 Fix redfish operation over ipv6 link local
Change-Id: I50149cc0eeea2affe727ddd6888cd656c52f6c1f
2021-11-09 12:15:05 -05:00
Jarrod Johnson 915a2afbed Detect 'default' nic by matching connection address
This carries forward the configure 'default' nic for
systems that nominally have multiple interfaces.

Change-Id: I5916efde5aa57d7682fe08eff0fdc8864d79aa52
2021-11-05 08:54:47 -04:00
Jarrod Johnson c2bd02e884 Recognize another etag message
Some implementations use a differennt msgid to indicate the etag
mismatch, fix support for those platforms.

Further, it was discovered that if the display label for a setting
changed the setting to no longer match the setting, the retry would
be invalid.  Support checking for mismatched spacing.

Change-Id: I9f83bfcf1c163fa36d6f684dd2685c828bd63507
2021-11-04 07:39:57 -04:00
Jarrod Johnson 982ef53f86 Fix redfish firmware update without progress
The caller opting not to have a callback is no longer a problem
for redfish updates.

Change-Id: I10378bb1d0491e1f446569eb443fa3023b4d2af4
2021-07-08 10:14:57 -04:00
Jarrod Johnson 73dfd3c62b Provide access to read redfish location info
The chassis info around location is now made available for
both reading and writing.

Change-Id: I69220acb88edb3cff1074357976c0e5ca01cbab8
2021-06-30 08:36:15 -04:00
Jarrod Johnson 01e9c27b3c Adapt the generic redfish virtual media call
Some vendors require the 'Inserted' attribute, others
can't support it at all, try both variants.

Change-Id: Ia8f0480a346cde24c5df99d63f90eba2093c6cfb
2021-06-28 16:02:41 -04:00
Jarrod Johnson fa21c4ad61 Add location data to redfish module
Redfish has a richer model for standardized location information.
Create a function to expose this.

Change-Id: I1460ee250f163b4d5a2be18147f8f4cd3e3d6a16
2021-06-22 11:23:09 -04:00
Jarrod Johnson deb2c6af47 Tolerate spec deviations
There are some popular Redfish implementations
that violate the standard. More gracefully
tolerate the violations.

Change-Id: I52d1bb21a812c8c721a6ee0888dd92b80944fd65
2021-03-26 16:47:30 -04:00
Jarrod Johnson f0b6160c99 Accept . for _ in redfish names
Prior to ODATA limitations, . was a common delimiter.
If a setting is a good match if substituting . instead
of _, go ahead and consider it a match.

Change-Id: I5da06464f34a1d0d7f4869312ef1c48fe2f858cc
2021-03-23 11:50:09 -04:00
Jarrod Johnson ce333b3bfc Fix DHCP config logic on static input
Have static address and gateway both clarify
so that the DHCP logic does not get confused.

Change-Id: If1fa41e27c34694fc47d6a805c72ef6922ab38f4
2021-03-23 07:57:23 -04:00
Jarrod Johnson 86845c4e2b Add reseat to redfish command for XCC
This will allow XCC users doing redfish to reseat
using the HTTPS api.

Change-Id: Ib0582f4aafb20cd94972f2080df673fbd3abbab3
2021-03-03 15:23:25 -05:00
Jarrod Johnson 7c5dde9335 Support passing file obj for media
To be consistent with
the file object support, extend
the remote media upload
functions.

Change-Id: I9482644aa2cef032ea891c892e747304142f63df
2021-03-02 15:19:47 -05:00
Jarrod Johnson 1b4005ee19 Apply license from file-like object
Allow passing pre-opened files to apply_license.

Change-Id: I83e0e5352b15ef1dc73f65a1a54d0fbe03f10b3a
2021-02-25 14:25:50 -05:00
Jarrod Johnson bd247bbacc Add remote presence assertion to bmc config
For XCC class systems, expose the presence assertion as a setting

Change-Id: I2bae20c83647289fe5e08d9692875a9ce23906c6
2021-02-08 14:49:31 -05:00
Jarrod Johnson 619893b097 Move inventory to oem to allow override
Redfish is not the best at inventory. Afford OEM
extensions the ability to override and accelerate
inventory.

Accelerate XCC based systems with this facility.

Change-Id: I3b92961e661d44b4b0f35d497085fc68f76fdcf1
2021-02-05 16:22:10 -05:00
Jarrod Johnson 3cfee6d2f2 Add usb alias for floppy and usb for redfish
Particularly in redfish, there is a distinction made
from 'floppy', and some implementations do not implement
floppy correctly.

Change-Id: I983d4ba94579a850b36786f04cbe03af3fce8de2
2021-02-01 08:52:09 -05:00
Jarrod Johnson 7a2a016233 Fix redfish system config without dependencies
Some firmware has incomplete uefi configuration management,
have the dependency check disable when such a firmware
is encountered.

Change-Id: I08935c87a1c29d2ae2c318426dac16b411c38876
2021-01-04 09:34:08 -05:00
Jarrod Johnson 5918fd4c3a Tolerate variant of TSMA without sys OEM
If no OEM element in the sysinfo, check the manager.

Change-Id: I038ae3edcb82acebd33805723f18e1181b3d3d52
2020-06-05 09:21:17 -04:00
Riccardo Pittau a5129fbdb3 Update pep8 import order check
Set flake8-import-order version to 0.17.1
Full py3 compatible version.
Add all Python3 modules to stdlib list.

Change-Id: I3ef01e49c0e6822368146434f056ac7a1aa7ce4d
2020-05-11 14:08:17 +02:00
Jarrod Johnson ee57e7229d Retry on etag change
During the course of applying
configuration changes, the pending set
may change for some reason.

Repeat the logic if etag triggers an exception.

Change-Id: I3783b4ba45dd0dd57fdd3af80af16223e39fce05
2020-04-16 09:05:23 -04:00
Jarrod Johnson 749189d843 Improve redfish errors and identify
For redfish, store the MessageId
for programattic processing.

For identify, use wildcard for
the identify etag.  While an implementation required
etag for set identify, it permitted wildcard.

It doesn't matter to check etag on something as trivial as
LED control, so just wildcard it.

Change-Id: If3cf600e46f38858551c5f744388a57393b45123
2020-04-15 11:03:10 -04:00
Jarrod Johnson 5391281a7e Give up on etag checking for log clear
Some firmware just gives etags that are random and useless
for guarding log clear.

Change-Id: I16ed712e012f9d5b0092fb3224618cf146e480c8
2020-03-30 18:32:05 -04:00
Riccardo Pittau b76d3b3cd2 Bump hacking to 3.0.0
The new version enables a lot of standard flake8 checks, so a few
fixes are required. W503 is disabled as it conflicts with W504
and the latter seems to be preferred nowadays.

Change-Id: I0d2fa8c88f081d553ebefb5f764397b2761dc2b5
2020-03-30 16:33:49 +02:00
Jarrod Johnson 85b2b6e5ab Fix endless loop with log clear attempt in redfish
Some redfish implementations endlessly mutate
their etag.  This makes it impossible to
fully establish atomicity.

Move the logic as much server side as possible.
There is still a window where entries change
between fetching the entries and the loginfo,
but there is little hope.

Change-Id: I9135b96acf82f06bc8622efb4d53d0bc695d1758
2020-03-26 10:21:39 -04:00
Jarrod Johnson 35351756bf Make reset Bios configuration adaptive
So of course it turns out that in redfish
multiple firmware developers implemented
another exactly identical behavior with
different requirements.

Accomodate by trying to detect at least two
variants seen in the industry.

Change-Id: I5aec979f12fd775bcf8570fde411eaee787ba9c3
2020-03-25 12:03:04 -04:00
Connor Reed 584f51cdd8 feat(redfish): Add port option to be able to specify redfish server port
Change-Id: Id60b6fe82c81d9eea9aba1b6b3b6a55c6d9d8f9e
2020-03-03 15:36:05 -05:00
Jarrod Johnson d93718e306 Prevent overwrite of existing files.
Fetching new licence keys or diagnostic data should never
overrite existing content.

Change-Id: I41519dc59544165e244b39cef2f510eeb4c0f15f
2020-01-31 10:20:48 -05:00
Zuul 2e3c8d4f1e Merge "Show True and False as choices for booleans" 2020-01-23 21:29:33 +00:00
Jarrod Johnson 92771354aa Show True and False as choices for booleans
Boolean settings inherently have choices to
offer, enumerate them for better help text.

Change-Id: Ibce17930f151244eaae0bc02759757c2070627cc
2020-01-23 16:11:39 -05:00
Jarrod Johnson 572c9f9185 Support Boolean types for redfish uefi attribs
BIOS settings set as boolean are now handled with some
sanity.

Change-Id: I77eb3dd3259746ae4739a2f4c255bdc8d62db9d4
2020-01-23 15:27:38 -05:00
Riccardo Pittau 8abbd9091e Prepare to switch to flake8 - 03
Third wave of changes to prepare to migrate to flake8 tests.

Change-Id: I4cb1347337b19ac890c17641c5c613f1972bcdc8
2019-12-17 15:13:19 +01:00
Riccardo Pittau 7f53f903da Prepare to switch to flake8
First changes to convert to use flake8 for pep8 checks

Change-Id: I4e8abf9cade63c7c3570006dd84c22afd2df7b29
2019-12-16 10:51:59 +01:00
Jarrod Johnson 6c1f7dd079 Add a 'not ready' for overview fetch
If the fetch does not have 'Systems', it seems to
mean the redfish subsystem is not ready yet
on the target BMC.

Change-Id: I6935ab31d090185e1bcc43364e8fc306f5635975
2019-12-02 15:41:24 -05:00
Jarrod Johnson 68e45b919f Extend TSM remote media to redfish mode
Refactor TSM core as needed to support OEM list
of media.

Change-Id: I2be297af57a9d02950cc8c081523fcc004c5fee2
2019-11-26 11:23:12 -05:00
Jarrod Johnson 4adf5a049e Fix some redfish incompatibilities
Some implementations require etag to set the identify light.

Some implementations do not provide the allowable reset values up
front and require chasing yet another url.

Fix an issue where a temperature sensor
without available reading caused an error.

Change-Id: Ie0b3c880b311438938d016857e4466c55447f7a3
2019-11-19 14:32:26 -05:00
Jarrod Johnson 929cd5b566 Avoid telling a server to enter existing power state
Some redfish implementations do not handle such a request
gracefully.  Avoid sending the command if the command allegedly
would have no effect.

Change-Id: I21b3ce18bb37747b71a67cbd0268d227ade6aad9
2019-11-18 09:14:08 -05:00
Jarrod Johnson 2e9a81f8f1 Offer more robust bmc reset
Error on unrecognized and also check
for a longer list of possible actions
that we wouldn't mind using.

Change-Id: I947ce7e76d28fe1e9a296c5c2a1e5a99a1a285ec
2019-11-05 14:06:56 -05:00
Jarrod Johnson 284bebb00e Enable OEM diag filename modification
This allows vendors to designate filename for improved compatibility
with support.

Change-Id: Ie855e5ff315000cfdc4e2c9a58f467a2c1f9529c
2019-10-22 14:59:05 -04:00
Jarrod Johnson 00a4780220 Improve nic configuration management in redfish
For one, improve the 'default' nic finding behaviors. This
allows a simplified view of even a somewhat complicated manager.

Additionally, add parameters so that multi-homed BMCs can actually
be managed.

Change-Id: I6b8f842a382cc32c80b7609e9ad574bcacf15b7a
2019-10-16 13:21:23 -04:00
Zuul d99e8fdf1c Merge "Fix problems with unrecognized health" 2019-09-17 13:00:31 +00:00
Jarrod Johnson c12253042f Fix problems with unrecognized health
This fixes problems

Change-Id: I2d198a2b675103ed9c51fd679835c79148ed829e
2019-09-13 14:01:50 -04:00
Jarrod Johnson b14b0487a8 Add etag to set_system_configuration
Some implementations require an etag here as well.

Change-Id: I821305d63fad52c78c27872f129bbafb601a90f3
2019-09-10 14:28:24 -04:00
Jarrod Johnson ee4219766a Convert integer when advertised
Rather than passing a value through, cast to int
if the registry is available and instructs us to do
so.

Change-Id: I1b057f15278ba0cd0e98d23b073e3333fb896589
2019-08-28 15:50:23 -04:00