2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-05 13:32:48 +00:00

986 Commits

Author SHA1 Message Date
Jarrod Johnson
20f964b9ca Add referer to XCC OEM behaviors
Some XCC firmware depends upon Referer,
thus we set it to an appropriate value.

Change-Id: I7b8ad46363c41377c315db745fdf6b2bd434b3f4
2020-07-30 09:15:29 -04:00
Jarrod Johnson
997e7da2fc Fix FPC configuration support
Change-Id: I6fa71a46954824a45c69bbe692f3001e3643b930
1.5.16
2020-07-27 12:48:01 -04:00
Jarrod Johnson
a30193a974 Coerce to str if bytes in python 3
Nextscale code received bytes but needed str.

Change-Id: Ie2951e9689fb7db1c9ff09d04a96acf0b779d638
2020-07-22 11:58:19 -04:00
Zuul
2f6c3430c6 Merge "Closes-Bug: 1887953" 2020-07-20 20:20:01 +00:00
Logan Blyth
dc98520469 Closes-Bug: 1887953
Change-Id: I057ce1cdf978f6e965e3f7a37950b01a51d7349c
2020-07-20 15:44:36 -04:00
Jarrod Johnson
eb1070462a In python2, we must change to bytes explicitly.
While python 3 is ok, with using a bytearray slice,
for pythton2 we have to explicitly make it bytes.

Change-Id: I7ba4f466d398892715b72695818b09d1cf57a794
2020-07-20 14:50:56 -04:00
Jarrod Johnson
ba05b8f883 Fix python3 issues with FPC interaction
Change-Id: I9ba8a15c07bf1ff03fc5c77ad6dfb5bd8c2693a6
2020-07-17 10:12:31 -04:00
Jarrod Johnson
ff67fc30b6 Add smm_ip setting to XCC devices under IPMI
This will give read-only view to the SMM ip address
when asking the XCC for an smm_ip setting

Change-Id: I40a14d6f27943fc8b18fa18b800e3f8679083f57
2020-07-08 16:12:26 -04:00
Jarrod Johnson
3c1c6edf39 Support newer storage api
Newer XCC firmware changes
the storage API, support the newer api.

Change-Id: I6740fab59098ae825be5f23c5eb28cbf2e85968f
1.5.15
2020-06-22 14:06:17 -04:00
Jarrod Johnson
3150bb8930 Add dateutil requirement for python2 users
python3 pulled in dateutil, but python2 did not

Change-Id: I3006928d21bcae7a34b8cdb1530e1e72733c862a
2020-06-22 10:13:54 -04:00
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