2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

858 Commits

Author SHA1 Message Date
Jarrod Johnson
87c7840c09 Fix python3 for ipmi set user
First normalize to bytes and then use byte to null
pad and finally use bytearray to normalize the
2 and 3 to behave the same on indexing and use that
for extending the command.

Change-Id: I9e3e89f5f8ac411c770f1a6371f9b365868e8c87
2019-10-11 09:29:51 -04:00
Jarrod Johnson
8fe5049005 Fix python3 compatiblility for upload
File upload would fail in python3, correct
by using binary strings consistently.

Change-Id: I95b4edd6a9fabd192d809959390ffc96d0765666
2019-10-08 13:48:40 -04:00
Jarrod Johnson
d794d57fba Fix mistake in python3-ification
Change-Id: Ia2a4feb16c8b9c0fa4206d72c08e1b5f8841021d
2019-10-04 16:55:49 -04:00
Zuul
79973a263b Merge "Further Python2/3 compatibility" 2019-10-03 19:01:57 +00:00
Zuul
ea14a22b39 Merge "Add a spec template for rpm build" 2019-10-03 18:55:16 +00:00
Jarrod Johnson
8f16d9bdf5 Further Python2/3 compatibility
More places had python3 problems, address those areas.

Change-Id: Id0b648c2764f8c039e96ae3adbe2f64400e7355e
2019-10-03 14:43:59 -04:00
Jarrod Johnson
1fe80e7960 Fix various python2/3 problems
Normalize as possible to str type, whether that is bytes or unicode.

Fix internal consumers of xraw_command that have bytes expectation that
get broken by memoryview being more bytearray like.

Use io.BytesIO as python3 stdlib doesn't like it's own StringIO.

Change-Id: I0140c8c19421786949a52b0e1fa4b392684a78de
2019-10-01 15:34:09 -04:00
Jarrod Johnson
93107e83a5 Add a spec template for rpm build
The main spec file can be a challenge for some
to build.  Provide a simplistic spec file with
reduced function.

Change-Id: Idc295f3eda7b708f0258f8d0934e3fed6a2950d8
2019-09-24 16:33:15 -04:00
Jarrod Johnson
33aee1ecdb Hook redfish sys config to TSM IPMI OEM
Use redfish to do system config under ipmi plugin
when communicating with a TSM

Change-Id: I6f0ce7f8abe664f4ebe0d49e5162554075523b86
2019-09-23 09:31:13 -04:00
Jarrod Johnson
6d7231ff41 Add OEM firmware retrieval to SR635/SR655
This provides more detail on core firmware on the TSM
servers.

Change-Id: If9fad33d1d512ac7f9b70cc971e84eae1c3ad74e
2019-09-20 15:59:54 -04:00
Jarrod Johnson
a981b4067c Refactor TSM code to common with redfish
This gives common access to TSM OEM function to redfish
and IPMI (which really is using https here).  Should any
function come up which absolutely suggests IPMI use in the
TSM module, it will be conoditionally enabled by ipmi side
and ignored redfish side.

Change-Id: I635e3a1cb2f333930a5b8f2e0dc90c08e4ec72d0
2019-09-19 16:41:40 -04:00
Jarrod Johnson
8a594e4640 Fix display of change interval
The incorrect value was pulled into the change interval
display value.

Change-Id: I2115b32066fea976f645b0bfe63c159a0115f26d
2019-09-19 10:43:28 -04:00
Jarrod Johnson
d8c45524ae Add Update of TSM for SR635/SR655
This allows update of TSM and UEFI firmware

Change-Id: I8d32fddd169805c0f5b13ecbb553d4b4272e334b
2019-09-18 17:03:58 -04:00
Jarrod Johnson
f24019eed4 Fix incorrect rules scope for SMM
The SMM ruleset erroneously emptied array each pass.
Fix by moving to the correct scope.

Change-Id: I3e8984c89bf4297883bd6dbd9e478774fd032ebf
2019-09-18 11:03:20 -04:00
Zuul
d99e8fdf1c Merge "Fix problems with unrecognized health" 2019-09-17 13:00:31 +00:00
Zuul
0b043966ff Merge "Add etag to set_system_configuration" 2019-09-17 12:55:24 +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
43553ea77b Fix typo in ruleset in set_bmc_configuration
IMM handler had a mistake in the variable name.

Change-Id: I051b8b44407d10b685a02af63371fa4af8a9ca40
2019-09-12 08:37:30 -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
b5dc8a8b9d Add fanspeed to bmc config for SMM
The D2 offers some fanspeed control.  Expose this through extended bmc
configuration.

Change-Id: Ia744538f7d735f54aeaf0404add99c2dce15a1d9
2019-08-30 10:05:12 -04:00
Jarrod Johnson
793d1dcd23 Add SMM password policy to bmc configuration
The SMM has a number of account policies.  Provide these using
the same vocabulary as XCC account policies.

Change-Id: I0fa12f252468aaab8952763b6824a97aea666e19
2019-08-30 09:29:16 -04:00
Jarrod Johnson
795ff2d046 Set warning according to expiry
Since the expiration warning can block expiration, always
set warning when expiration set.

Aim for 8% of the interval.

Change-Id: Iecffb9c26822a21632b22170607bb2019fb52e29
2019-08-30 08:25:47 -04:00
Jarrod Johnson
c711fc5dbe Add password settings to xcc extended attributes
This gives access to the password policy settings to
the xcc, both read and write.

Change-Id: I9a449eee1b46f5cd6856411cc4578ef52fcfcdd4
2019-08-29 15:46:50 -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
Jarrod Johnson
684ffe30da Support instanced configuration
Add suspport for instanced configuration attributes.

Change-Id: Idf5026fddc4318e847f42ac9fd44ce643c463100
2019-08-27 11:29:16 -04:00
Jarrod Johnson
40cb397ae7 Implement extensible BMC configuration
In much the same way system_configuration permits a system to
extensibly describe UEFI/BIOS type configuration, offer OEM modules
a mechanism to do the same for BMC specific settings.

Change-Id: Ic6be1b90247afe9b43af498e90e4d139343a5124
2019-08-26 14:59:37 -04:00
Jarrod Johnson
d5786feede Support report settings on read-only BIOS
Some redfish implementations support reporting the current
settings, but not changing them.

Support these platforms in an expected way.

Change-Id: Iacce6f35019516b57b5de171044653c96a05a892
2019-08-26 09:57:05 -04:00
Jarrod Johnson
414baadea2 Use etag on setting boot device
Some implementations require etag matching for
setting boot device.

Change-Id: Ie8b86c1687b923f885186226185026f160b154f1
2019-08-14 16:13:07 -04:00
Jarrod Johnson
3c1196e3ae Explictly manage Host header when % present
Some implementations do not like the way python preserves
% in the host header.  Workaround by removing it from the
Host header (it has no meaning for the server anyway).

Change-Id: I49942e9c93f02fc4ee600174db4b51fc03d64d8e
2019-08-14 14:53:17 -04:00
Jarrod Johnson
dc121ebd77 Amend to add back a missing portion of partial patch
The previous change was only half of the actual change.

Change-Id: Iaecc0279eb4252af070c925d86466c8a6307b9de
2019-08-08 16:04:07 -04:00
Jarrod Johnson
6a7df11e3c Fix behavior of unavailable sensors in redfish
In IPMI, we provided a reasonably viable result for unavailable sensors.
Set unavailable attribute on the reading to indicate this in redfish.

Change-Id: I841dbc8c9660abd84ee59eab9c3006dc51949de3
2019-08-08 15:10:32 -04:00
Jarrod Johnson
9cb6cebf26 Map subordinate chassis when doing sensors
Some implementations model subchassis.  For those, descend
into the subchassis to get those sensors.

Change-Id: I4ed9b3599edffe897821a8571205a75afb6b49f0
2019-08-07 10:55:48 -04:00
Jarrod Johnson
1682a83622 Allow setting UEFI/BIOS settings without registry
Bypass the dependency and value checking when no registry is
available to provide that capability.  This allows users contending
with lesser implementations to at least get somewhat further.

Change-Id: I5ac47e42cb6c0e5e2c07ae8c8a68b089e5e2e84a
2019-08-06 10:01:46 -04:00
Jarrod Johnson
bc98dd61b9 Revamp redfish get_health
Check ProcessorSummary before going into each processor.

For each component, skip if Absent.

If the system provides no health info, warn that the health
information is unavailable.

Change-Id: I7cc020ae0ae8a958b0d474a9012921d022979511
2019-08-06 09:38:44 -04:00
Jarrod Johnson
196e70b447 Fix redfish issues
Fix the remote media generic path to actually try to work.  This
required adding a stub attach function to the generic oemhandler class.

Fix adapter health checks being skipped if no memory errors are seen.

Change-Id: I3c6bc2c32fa63545a89cd005b4fbb2a271dacfbe
2019-08-02 08:25:25 -04:00
Jarrod Johnson
bfbe3f41c2 Hardcode SHA1 in BMC side for now
BMC side should properly look at the Open RMCP request
and do the appropriate thing.  For compatibility, just
run things exactly as they were for the moment.

Change-Id: I2b6671e8672bc1f4e9521823db9122a93405863c
1.4.1
2019-07-29 11:32:16 -04:00
Jarrod Johnson
eb73628360 Support HMAC SHA256 in IPMI
While SHA1 is technically secure in an HMAC, some implementations
no longer allow it by default.  Try for SHA256, and if that should
fail, fallback to SHA1 for implementations lacking support.

Change-Id: I6380e042fbe959af4059e63a5620f6289263737c
1.4.0
2019-07-26 11:40:55 -04:00
Jarrod Johnson
f1e9ecf15c Fix event log date processing
Event log was incorrectly processing.

Change-Id: Ibaac463eb9ca537daa818ac60da1539f41e72c61
2019-07-25 14:39:13 -04:00
Jarrod Johnson
9d028dbde5 Add log_id to redfish logs
Since the get_event_log is combining the logs,
provide log_id for calling software to optionally
include to categorize.

Change-Id: Ifafc456b689eb76588ee1102bd7a2c4d9c639ac4
2019-07-25 13:21:32 -04:00
Zuul
2f961f6c5f Merge "Graceful error on no https in get_health" 2019-07-25 17:15:36 +00:00
Zuul
21504338a5 Merge "Provide get_event_log even when time unparseable" 2019-07-25 17:15:06 +00:00
Jarrod Johnson
ace29963d6 Graceful error on no https in get_health
Rather than timeout, provide a more informative
health message.

Change-Id: Ideb0d86c84a4e702ad38a4d5a1ac51c6e610b57d
2019-07-25 12:45:51 -04:00
Jarrod Johnson
a578d783f7 Provide get_event_log even when time unparseable
If a format that is not supported appears, at least
pass through the value.

Change-Id: I96d2ef6cb36bdfe9d993a3c046105589cd101000
2019-07-25 12:43:45 -04:00
Jarrod Johnson
4350b50afd Better error message on no License for XCC
The XCC manifests inadequate license in listing fewer slots.
Provide a more descriptive error message.

Change-Id: I27c77dfee700fc288af8bd5c6b7df65ec64616d1
2019-07-25 10:04:25 -04:00
Jarrod Johnson
142ff10cb2 Support setting BMC hostname in redfish
Provide write access to this currently read only property.

Change-Id: I4e4fb7dc836e6657add73205ec2a95977111ffe1
2019-07-22 15:06:17 -04:00
Jarrod Johnson
5860b3796a Fallback to direct ipv4addresses manipulation
A redfish implementation may forbid writing to it,
however others allow only writing to it.

Change-Id: If4e1f6a737cb6b1460d73cbe9faf30c18951f890
2019-07-22 13:42:37 -04:00
Jarrod Johnson
b6fb57dfa5 Relay errors on invalid licenses
License errors are now raised to the caller.

Change-Id: I0fc107525b4d009dfd6c7ad52ab356a9dcaac5c0
2019-07-22 11:12:19 -04:00
Jarrod Johnson
64b6c078d6 Fix memory health
Mem is an odata dictionary, fix by referencing the correct
element.

Change-Id: I6e90a5f0b689283019a09b4766257f294fbc1402
2019-07-19 16:02:39 -04:00
Jarrod Johnson
f26fc5401d Check XCC HTTP service health
If the service is unreachable, emit an error
explaining the situation more clearly.

Change-Id: I5cc04d7fbec31869e9248936718543e480e60e29
2019-07-19 15:16:42 -04:00
Jarrod Johnson
cfb50d0598 Change bmc restart type to graceful
Generally speaking, this is all BMCs know to do anyway.
Some make the distinction and refuse the Force variant,
so go for the Graceful.

Change-Id: I093261e46b8ce7305d8be9938e45579cfc367110
2019-07-10 13:41:22 -04:00