2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-13 11:17:47 +00:00

904 Commits

Author SHA1 Message Date
Jarrod Johnson
9960dc570d Remove IPMI only function from Redfish
The force inventory is only available through IPMI.

Change-Id: I2395adf3032f1eb8885885976805984cf7450117
2020-01-09 15:55:04 -05:00
Jarrod Johnson
e2c6489c2c Detect indefinitely broken session and mark it
There are evidently scenarios where an orphaned object could
be stuck in logging indefinitely.  Place a cap and automatically
mark the object if it suffers from this.

Change-Id: I60733c1eabb56494ad848595b46240af82c186d3
2020-01-07 16:25:09 -05:00
Riccardo Pittau
90d02c0a03 Use flake8 for testing
Start using flake8 for style guide enforcement.

Change-Id: I9d7c89498c10e682acf0f75bad20dfd4bb6152b5
2019-12-17 16:04:42 +01:00
Riccardo Pittau
4f9103d5a7 Prepare to switch to flake8 - 05
Final wave of changes to prepare to migrate to flake8 tests.

Change-Id: I75c3acfc8b0ab34b82faf7b500ec9c27aa3efa91
2019-12-17 16:02:46 +01:00
Riccardo Pittau
e665ced5b4 Prepare to switch to flake8 - 04
Fourth wave of changes to prepare to migrate to flake8 tests.

Change-Id: I92b56e3f6c64acd05fc4e7a65789e836c47f4000
2019-12-17 15:55:46 +01: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
ae21ae184d Prepare to switch to flake8
Second wave of changes to prepare to migrate to flake8 tests.

Change-Id: I0bf7ad7575eacac63e2e4d6f4066c8f51587943c
2019-12-16 17:20:07 +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
a0c3adf478 Add missing generic stub for detach_remote_media
The generic oem handler needs a stub to allow the generic code to work.

Change-Id: I565625e575c5e8afb3ca3d1b5ebd468a08b01fbe
1.5.3
2019-12-15 19:40:33 -05:00
Jarrod Johnson
a1fe180e04 urlencode was not properly imported for py2/py3
This function move was not accomodated everywhere.

Change-Id: I31839b84e750b0fc25a379db640193366a14c8c4
1.5.2
2019-12-12 10:01:05 -05:00
Jarrod Johnson
14cefc6502 Fix Python3 SMM setting
Under Python3, indexing a bytes gets a number instead of a str,
adjust to bytearray which is number in both 2 and 3.

Change-Id: I249729c2287bb58dd764a627c298c74e5ebb50cc
1.5.1
2019-12-11 10:00:50 -05:00
Rabi Mishra
a1cea91038 Add python-dateutil to requirements
With change I1b5ad99c89d8dec0abd18b1f794dabdb0aed13c3, parse module
has started using python-dateutil, but it's not been added to
requirements.

Change-Id: I779f654f4529e863b8feeaebc20ee7467176ad75
Closes-bug: #1855983
2019-12-11 12:23:29 +05:30
Jarrod Johnson
2bf19d3128 Fix modification of input headers.
When given custom headers, webclient was persistently leaving
the Content-Length modified.  Fix by making a private
copy before potentially modifying it.

Change-Id: I2de5268ffc35a725e7b9d360214eab498d2ac788
1.5.0
2019-12-10 11:44:14 -05:00
Jarrod Johnson
dec668cc21 Convert BadStatusLine result
If the BMC violates HTTP specification,
just make it equivalent to a 500
error.

Change-Id: I66f5cb5b39f03a6c738b1e52e596fd6bdc73c0bd
2019-12-05 15:25:27 -05:00
Jarrod Johnson
1c50fcbcfe Fix incorrect HD path
If HD was mounted without CD, it was incorrectly
referring to CD path information.

Change-Id: Ifa6e1fb4db60afc1b9b2d67054fe4102809f7643
2019-12-04 13:52:05 -05:00
Jarrod Johnson
de25adb4f1 Handle 109 on verifystate
Sometimes the 109 comes later, depending on the circumstance.

Change-Id: I19ff60bb0ff1a2a431b7a80bf680711c01a5c6b2
2019-12-04 09:26:02 -05:00
Jarrod Johnson
d34945846e Provide better error on XCC 109
The 109 error code means the file was not
recognized, which can mean the file is incorrect
or that the update provided is not one that
supports remote update.

Change-Id: I4437916b5812b9cb0dfb9e92460a2f8a7c850849
2019-12-03 11:38:10 -05:00
Zuul
6a9f5ea6cc Merge "Make fishclient optionsal on list_media" 2019-12-03 16:29:15 +00:00
Jarrod Johnson
810a75821d Make fishclient optionsal on list_media
tsma is shared between IPMI plugin and redfish.
Since IPMI doesn't provide fishclient and tsma doesn't use
it anyway, make it optional argument.

Change-Id: I0bd9e72c0aae713b96a8ef28244e7182dcc1e1a7
2019-12-03 11:08:16 -05:00
Jarrod Johnson
c469f22a2f Fix some issues with service data
There were a couple of issues that are inadequately
explained and also a chance of failing during report
on the download.

Change-Id: Iac358f6f6b96925aa823d49fb94a320a99a90c23
2019-12-03 11:04:53 -05: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
3b3204b8bf Stop assuming a return for select
The code no longer uses tmplist for anything.  It has been observed
that select.select may return something other than a 3 member
tuple, so become apathetic about the nature of the return.

The fact this can happen is in all likelihood a bug in the select
implementation, however it's hard to nail down and easy enough
to tolerate.

Change-Id: Ib13a6dcce0809f9c2c4d9f02e19adc9de818f3fb
2019-12-02 14:50:06 -05:00
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