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

882 Commits

Author SHA1 Message Date
Jarrod Johnson
2a40dd8cad Implement diagnostic data for SR635/SR655
SR635/SR655 presents a distinct interface for getting support
information bundle. Implement that interface.

Change-Id: I38b2196b743a50f02702a6ffb3e538ddf0587984
2019-11-26 13:34:38 -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
2adaf00bd2 Add TSM remote media support
For the SR635/SR655 implement the media management commands.

Change-Id: I9675729c3ca3ebe07f770fa1504eb347953dd715
2019-11-26 09:56:58 -05:00
Jarrod Johnson
9bff4096b1 Add debug in case of failure to retrieve TSM
This could help ascertain why the information is
missing upon occasion.

Change-Id: I41133cc168eafd90938c6dbb54a73ff214abdb21
2019-11-22 09:36:01 -05:00
Jarrod Johnson
9d5e570f0e Check HTTP viability before use
If the session is dead, have the wc property function discard and
re-establish the connection, rather than passing the useless
stale session to the caller.

Change-Id: I701c396ac9eedc1749b13c196e19fb1c4e996001
2019-11-22 08:45:26 -05:00
Riccardo Pittau
d5213a7369 Drop old Python versions
Python 2.6 is dead since a while and we should move out from
Python 3.5 in favor of Python 3.6 and Python 3.7

Change-Id: I36ff0e1bc1db018bb7cce00a741682125aca4ac4
2019-11-22 12:19:11 +01:00
Jarrod Johnson
e2c1b68608 Fix use of ord() in remaining places
There are some places with leftover
ord() calls on a bufferview.  Normalize
to 2/3 agnostic way.

Change-Id: I8ca51d6477990de072dece6c8bd346d0d6105af6
2019-11-21 15:35:31 -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
430ae6f171 Add PSOC update to SR635/SR655
This enables update of BP from update
file.

Change-Id: Ic9bf4600abd07cc43504116c1ee407918bcc070e
2019-11-19 13:25:43 -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
2311bc9f0b Fix potential for loop on mark_broken.
If a session is doing a best-effort 'logout' due
to a mark_broken scenario, do not activate the
timeout logic, which will cause it to endlessly
recurse into itself.

Change-Id: I9b84d3138f161cc982dd1107586d31be68523108
2019-11-15 10:31:54 -05:00
Jarrod Johnson
114e908947 Try to deactive SOL on logout
If we have an sol_handler, request SOL deactivation
on the way out.  This works around issues on select
codebases where IPMI stack state gets corrupt if a
payload is active during ipmi logout.

Change-Id: Ie1bcada6206c340bb954e5d5c8a99678e1d3162c
2019-11-12 09:39:04 -05:00
Jarrod Johnson
e661610bb5 Fix format of UEFI info from a TSMA device
Errant comma was causing the data to be the incorrect type.

Change-Id: Ic7b6dc8158d259ca04914bd4668151c99569a68e
2019-11-06 17:04:14 -05:00
Jarrod Johnson
0ba4437422 Fix BMC security config
It was only enabled for SD530, extend
the support for non-D2 platform servers.

Change-Id: I3dfa02b1eef4baedc12e0e031278c7bc49627e4e
2019-11-06 14:15:53 -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
ce71add93d Error if TSM fails to provide info
TSM may be in a state that cannot
provide firmware information, raise
an exception in such an event.

Change-Id: I8706624f4b46e12b470a78949ea429469e2d9640
2019-11-05 13:19:17 -05:00
Jarrod Johnson
9ccd587581 Fix firmware info on incomplete data
The UEFI information may be incomplete.  Gracefully degrade as required.

Change-Id: I37b58a7ff3c0e9c1ccc08019202783fb79e8f4a7
2019-11-05 11:38:00 -05:00
Jarrod Johnson
951f1bb3f4 Return potentially modified filename
Since the autosuffix function can change the filename,
return the modified name so that the caller knows the
changed name.

Change-Id: I751d32d70f0d2c1813b1af081ee61b07a8faab90
2019-10-29 16:09:56 -04:00
Jarrod Johnson
44bf8d79b3 Fix mistake in the health fallback
If an event with unknown severity occurs,
do not place a string in the enum value.

Change-Id: I86e96b5b329ca3608dfec67a4043c52fde1a7175
2019-10-24 15:20:51 -04: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
0c20d79a8c Support newer TSM level
Newer TSM requires JSON rather than form encoded auth.
Try the newer method and fallback to form for compatibility.

Change-Id: Ic0fd8fe949eb0bc328c57038e998d8c9570e7054
2019-10-22 09:05:33 -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
Jarrod Johnson
3b0fe82dfa Fix Python3 incompatibility in DCMI
DCMI uses ord on a buffer/memoryview.  In python2 this
makes sense but in python3 it does not work.  Switch to
use of bytearray which acts same under both.

Change-Id: I83ad3ec087db820a44e09edf0376b6237af9ca87
2019-10-15 09:40:15 -04:00
Jarrod Johnson
c4a61ca3c8 Fix SR635/SR655 firmware updates in python3
Accomodate python 2 and 3 names for urlencode and
consistently use binary bytes in processing the hpm
contents.

Change-Id: Id733e09c317135a04526e307d850d7c6bc399955
2019-10-11 15:17:20 -04:00
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