2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-30 12:57:39 +00:00

976 Commits

Author SHA1 Message Date
Jarrod Johnson
583e8418d3 Do not swallow TSM errors
Raise TSM ffdc download errors
if they should occur.

Change-Id: I431f4942164866aec6ffba01c7c4f4c10156f101
2020-06-09 09:32:50 -04: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
Jarrod Johnson
bb0516af93 Fix setting passwords in python3
python3 str/byte differences strike again,
use python2/3 consistent form to fix.

Change-Id: Ia3cb4c900d7f2ceffd4e0e2bfc7cfca487af5721
2020-06-03 13:58:04 -04:00
Zuul
2e6a1d0910 Merge "A redfish device with no OEM should be generic" 2020-06-03 14:50:47 +00:00
Jarrod Johnson
e0b06fe39a A redfish device with no OEM should be generic
Fix the fallback lookup to avoid a stack trace.

Change-Id: Iee2b0891a91687cf13d74936161f548da49c3a6a
2020-06-03 08:55:21 -04:00
Jarrod Johnson
d5621700e9 Ignore 'fault' light for info-only events
There is no action to take for information-only events.

Change-Id: I41b021cb85c7e031bc857808c465895606bda68a
2020-06-03 08:54:10 -04:00
Jarrod Johnson
60f31bb671 Add dateutil dependency
While confluent does pull in dateutil, pyghmi
itself depends upon it, so it should pull it in
as well.

Change-Id: I3af963f14451bf6efac0c74981c6644df9950d05
2020-06-03 07:37:34 -04:00
Jarrod Johnson
9441b9ec79 Fix RDOC upload of large images
Large images take some time before
they can be mounted. Track
the size field to see when the
file is actually done copying.

Change-Id: I23c921798d6be4370e7314822d37fba1cb9faad3
2020-05-22 17:46:50 -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
17d1b79a57 Fix python3 compatibility with older IBM
Older IBM tripped over a problem in energy manager
due to a bytes value not prepended with b.

Change-Id: I81cb68805ddaf5c4ae79eafb08fa4c27672945f2
1.5.14
2020-04-17 13:14:46 -04:00
Jarrod Johnson
2165dfde72 Support newer XCC firmware raid
Newer XCC firmware alters the
API for storage.  Support both
new and old API.

Change-Id: I97e6a7f4c85ab0361758c5328084145cc87d97f5
2020-04-17 10:25:32 -04: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
6d3c032312 Fix KCS on python 2
In python2, cannot directly copy a memoryview to a ctypes
string.  Catch and try with a copy of the memoryview
data for python2.

Change-Id: I6dc0183921e4e888aca131fe7968d820b25dc5d5
2020-04-07 08:52:51 -04:00
Jarrod Johnson
92f1ed7b7d Disable OEM on KCS
When using KCS, OEM extensions are not going
to work well.  For now, disable such extensions.

Change-Id: Ic9668ec00906382f4aba94eff0b33ff270869d6b
2020-04-06 09:16:29 -04:00
Jarrod Johnson
ec3411b492 Fix localsession for python2
Commands without data were causing problems
for python2 ctypes interface.  Skip the
copy attempt when there is no data to
copy.

Change-Id: If115a1145c277992aa4ffbe420a582dc08d0926e
2020-04-02 08:09:02 -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
Zuul
bb2e8a24fc Merge "Bump hacking to 3.0.0" 2020-03-30 15:41:36 +00: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
1ae0ddcf29 Fix SEL sensor id with LUN
With support for non-zero LUN,
update portions of event log
to be consistent.  PET does not
seem to have LUN in the data,
so for the time being just assume 0 there.

Change-Id: I24b6b27f81fe1c24a516d28788a2c0efc2f9ccbb
2020-03-30 10:22:47 -04:00
Jarrod Johnson
72b092f449 Filter out disabled sensors
When get sensor reading says
a sensor is disabled without
also saying it is unavailable,
mark it as unavailable.

Change-Id: I00c61824f3539373b48223da9b37acfed97f6576
2020-03-27 14:49:02 -04: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
Jarrod Johnson
9f7e4415a9 Restore cloned webclient TLS validation behavior
In supporting the standard validation, custom validation
was broken when a webclient was cloned.

Change-Id: Ib2e2b8ca9c1582c778539b35ff7ee456f3118f82
2020-03-20 16:43:38 -04:00
Jarrod Johnson
1287100c7b Add SMM support for dhcp options 12 and 60
Provide access to dhcp settings for options 12 and 60.

Change-Id: If5b079fc7123d1ab0ac6ae2bacc6f3b5a06abbe8
2020-03-20 14:36:07 -04:00
Jarrod Johnson
767efd60a8 Fallback to standard TLS validation
If the caller provides no custom validation, use normal validation.

Historically, this webclient has been used for internal networks where
custom validation was more feasible than normal TLS validation.

However, it is starting to be used to communicate with internet sites,
so a change is required to work with that model sanely.

Change-Id: I31dae103bfbe534aa326a648f9207ad86b86d550
2020-03-20 13:07:08 -04:00
Jarrod Johnson
59f44fa9c8 Reduce instances of duplicate login
While XCC is aggressive about expiring tokens, sometimes it isn't.

In such a case, throw a logout request to the 'stale' session in case it
isn't to avoid consuming too many session slots.

Change-Id: I01819786755d5d5d29014c58d4dcbe5468c63607
2020-03-20 09:20:01 -04:00
Jarrod Johnson
ec4b503edb Have BMC side reply to get cipher suites
Newest ipmitool expects a reply to get cipher suites.  For
now give a static reply that only cipher suite 3 is supported.

Change-Id: I31f77818ffa746954eb86fa95269b1e5a7e09879
1.5.13
2020-03-18 15:18:11 -04:00
Jarrod Johnson
dd10bb7579 Fix download error reporting
Threaded downloads now
store the exception for passing
to the caller.

Change-Id: Ibe4a7a267b04a2775ad3775dd904a4e3c7520ebb
2020-03-11 11:06:07 -04:00
Zuul
daf2c36fb5 Merge "Rewrite download loop" 2020-03-10 19:27:49 +00:00
Jarrod Johnson
4d0ee6238e Rewrite download loop
The sentinal value would not get hit with
python3 ('' versus b'').  Change to use
an easier to use while loop.

Change-Id: I4d7f4b763aff1fdf13e5a53377146606de199a11
2020-03-10 14:23:40 -04:00
Jarrod Johnson
1be749343b Fix setting instanced config on XCC
XCC has some numeric data
that must be forced to str for
XML.

Change-Id: I86fed505d80d53b3ce3b4db33af678d548da847f
2020-03-10 13:53:02 -04:00
Jarrod Johnson
32f2e2827f Fix python3 on IMM
There was a python2 assumption in the
imm code for pre-XCC devices.  Fix
this mistake.

Change-Id: I48871f3d6d34533db0ad6d7facb8e693f4eca37a
2020-03-06 09:29:31 -05:00
Dmitry Tantsur
52228f84c2 Add a non-voting job with virtualbmc
Change-Id: I5c2b601689649ff70535b8c25d209946f7d04231
2020-03-04 21:32:45 +01:00
Jarrod Johnson
51ab5ca823 Fix server session to properly support rqlun
Honor rqlun from client, if not zero.  There are BMC implementations
that fail to follow the spec and do rqlun of zero, but pyghmi
implements it correctly.  In practice I have never seen an
rqlun of non-zero except as an experiment.

Closes-Bug: #1865987

Change-Id: I73e59672ce5e146cf24386c2228fa8dae3bc579c
1.5.12
2020-03-04 09:01:02 -05:00
Zuul
a3001d87a7 Merge "Rework LUN support" 1.5.11 2020-03-03 21:03:29 +00: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
b48cdba5f3 Force body to str for json
Some versions of python cannot take bytes
for the json payload.  Workaround by explicitly
decoding from utf8 in such a case.

Change-Id: Idb86003fcf6643e5c67e13202de41be6c35607a0
2020-03-03 14:37:37 -05:00
Jarrod Johnson
aa1bc4d183 Rework LUN support
Make code more closely resemble the spec mostly for readability.

Change-Id: I89e229645b6cea942f1dca6082f57083a935955a
2020-03-03 09:13:47 -05:00
Jarrod Johnson
39a1fa0985 Another fix for non-zero LUN
Accidentally did not have it treated properly
in add_sdr and get_sensor_data.

Change-Id: I5b55de6baf393fdfb686f6a574fee874e610a9a0
1.5.10
2020-02-28 15:39:09 -05:00
Jarrod Johnson
b497af048f Fix incorrect sdr cache naming
The order of operations was incorrect, be explicit
about the order of bitshift versus addition.

Change-Id: I8e3e92e47b82b6f84ffc54437c9c0e9888faa9a6
2020-02-28 15:14:23 -05:00
Jarrod Johnson
fa7e271f54 Discard rsLun in reply
After adding support for non-zero lun, some reports came back of
dropping responses.  However, there is at least one platform that
incorrectly puts 0 in rsLun in replies to packet that had 0 in rsLun.

Workaround by masking out the rsLun value in replies before checking for a
match.

Change-Id: I23a46fce23327ce90d2be845a806d6ba0c4b975e
1.5.9
2020-02-28 14:24:24 -05:00
Jarrod Johnson
ba8087a2ed Set daemon for IO thread
The IO thread is meant to be a background task.  Mark it
as such to be treated properly on interpreter exit.

Change-Id: I73003625d014f823d26c55bdd22217e19f6bf1c9
2020-02-28 13:10:51 -05:00
Jarrod Johnson
6bc53a1546 Add a simplesession option
simplesession represents a stripped down session.

For now it doesn't support many bells and whistles, but it
should suffice for one-off command usage.

Caller has to opt-in to the experimental simplesession by
calling select_simplesession() method in command:
import pyghmi.ipmi.command
pyghmi.ipmi.command.select_simplesession()

Change-Id: I3884762621306d4a895f4b56d173fc80526a095c
1.5.8
2020-02-26 16:31:09 -05:00
Jarrod Johnson
0f397ac0d9 Support non-zero LUN
Some sensors may have non-zero LUN.  Support this behavior.

Change-Id: Ibad7a1c378ef0ef5955fa81e3f110db0e8c42e90
2020-02-26 11:33:03 -05:00
Connor Reed
ba699294ca fix(kcs): Fix the command class to use bytearray instead of lists for raw data
Change-Id: I55ef076827447d3e0b8bbbd9d9dd8d0006804232
2020-02-25 11:20:46 -05:00
Jarrod Johnson
3221bb1ed3 Fix IMM/XCC over network
The change for KCS inadvertently used wrong variable name blocking
online usage.

Change-Id: I3b629e3697d73f6b36b2dc9d9755797fd348af0f
2020-02-20 13:02:40 -05:00
Jarrod Johnson
04b2d5cd69 Fix building under wheezy
The supported wheezy platform we are now adding
pyca to.  Additionally, the options were wrong for
such old debian build utilites.

Change-Id: If92de1356cd45c5f4a260b6df72144dbbfe70c3d
2020-02-20 08:58:24 -05:00
Jarrod Johnson
c180933281 Fix IMM on KCS
IMM on KCS did not even partially
work, allow at least partial functionality.

Change-Id: Ia42f4f91cdf29505423e05961101e7d7651f55d2
2020-02-19 17:06:49 -05:00
Jarrod Johnson
9958b75cc6 Transform IPMI version number for XCC
XCC convention is to zero-pad the minor number
if less than ten.  Support this and make it look less odd.

Change-Id: I093019d68d5c47ffe73d49eba736da5c1bd9ce32
2020-02-19 13:40:12 -05:00