2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-07 06:23:03 +00:00

954 Commits

Author SHA1 Message Date
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
Jarrod Johnson
2e12f5ce15 Fix KCS problems introduced by pep8 restore
The effort to restore pep8 made mistakes and mangled some
data.  Additionally correct a python2/3 incompatibility.

Change-Id: I247d00c3214c30d135c2c131d7ab7bd411dfb476
1.5.7
2020-02-19 10:33:41 -05:00
Zuul
01191cfd1a Merge "Guess a more specific type than Other" 1.5.6 2020-02-06 15:07:01 +00:00
Jarrod Johnson
2d72952e8e Guess a more specific type than Other
Some implementations use 'Other' since none of the specified
categories are technically Power.

For such a case, when it is in W, Ws, Wm, or Wh, correctly
flag them as power or energy category.

Change-Id: I515f74af6fc0cf3c2d14c6f94b74a295929cf082
2020-02-06 09:32:53 -05:00
Jarrod Johnson
4046a847a7 Redfish accept bytes as credentials
If the caller uses bytes, then try
to decode to string using utf-8.
This fixes compatibility with some
scenarios, particularly involving python
2/3 compatibility.

Change-Id: I78692db4f9e8abb885567eaf0e5500908e71a5a0
2020-02-04 08:40:28 -05:00
Jarrod Johnson
5d8a80c6e3 Remove vestigial argument of abandoned API choice
This API choice was aborted before it began, clean it up.

Change-Id: I0abd43e5c8f5286e1b7e3562a5e9519045b8a9d3
2020-01-31 14:01:52 -05:00
Jarrod Johnson
296f7d30dd Extend overwrite protection to ipmi module
This affords the same protection that the redfish module now
has.

Change-Id: Icc3e4f90427b2912d4d18d60af6f1f599b8005d9
2020-01-31 11:20:18 -05:00
Jarrod Johnson
d93718e306 Prevent overwrite of existing files.
Fetching new licence keys or diagnostic data should never
overrite existing content.

Change-Id: I41519dc59544165e244b39cef2f510eeb4c0f15f
2020-01-31 10:20:48 -05:00
Jarrod Johnson
9c0843443e Add SMM PSU configuration to bmc_configuration
When dealing with an SMM, give access to the PSU policy
configuration.

Change-Id: Ie6b5016e7db27391ddaa7a798a744f08bfd32ced
2020-01-30 10:09:32 -05:00
Jarrod Johnson
71932ba1c0 Fix IMM/XCC get extended configuration
Was modifying a dictionary while iterating, fix by
taking a list() explicitly before iterating.

Change-Id: I6a6310fabd7d205b4705a2f2216d316be502bbe5
2020-01-29 13:54:02 -05:00
Jarrod Johnson
3799dd3f9b Change API for extended BMC configuration
Keep extended configuration utterly separate to ease confusion
by calling code as to what belongs to which category.

Change-Id: Ic97ad79fa796f63b8825db48059450a4c78f75c9
2020-01-29 11:18:31 -05:00
Jarrod Johnson
27e8e36d23 Speed up uefi settings management
Bypassing the merged configuration makes the command go exceedingly
faster.

Change-Id: I86cb7baa09edfbcffdebf75a2019bf3c48cbe5f2
2020-01-29 08:28:44 -05:00
Jarrod Johnson
b4d4734df8 Wire redfish clear config to IPMI TSMA
When using 'ipmi', use redfish to provide reset UEFI
default configuration.

Change-Id: I744136c6ecadc8b0d1ddbdd9be528cf7780758ed
2020-01-27 11:11:17 -05:00
Zuul
2e3c8d4f1e Merge "Show True and False as choices for booleans" 1.5.5 2020-01-23 21:29:33 +00:00
Jarrod Johnson
92771354aa Show True and False as choices for booleans
Boolean settings inherently have choices to
offer, enumerate them for better help text.

Change-Id: Ibce17930f151244eaae0bc02759757c2070627cc
2020-01-23 16:11:39 -05:00
Jarrod Johnson
572c9f9185 Support Boolean types for redfish uefi attribs
BIOS settings set as boolean are now handled with some
sanity.

Change-Id: I77eb3dd3259746ae4739a2f4c255bdc8d62db9d4
2020-01-23 15:27:38 -05:00
Zuul
a7900c24b6 Merge "Connect redfish configuration to TSMA IPMI" 1.5.4 2020-01-22 19:53:47 +00:00
Jarrod Johnson
ce4f255862 Connect redfish configuration to TSMA IPMI
This corrects the inability to set for ipmi clients
of TSMA devices.

Change-Id: I253ae562bffc6129d41371b9cf4cbc669248b836
2020-01-22 14:35:40 -05:00
Jarrod Johnson
e58de7e0b7 Fix python 3 incompatibility in the FPC/SMM code
The use of ord against a bytes object is not supported
in python 3.  Change to a bytearray for compatibility
with both python 2 and 3.

Change-Id: I583c83d88c063aac2c085ac6dac8a23211a2f3eb
2020-01-22 11:24:30 -05:00
Jarrod Johnson
fb9b371d38 Add LXPM Lite image management
The SR635/SR655 has an LXPM lite that should be considered firmware
inventory.

Change-Id: Ieb968f20358f42d19e68f54057ea27d458bac002
2020-01-15 16:13:35 -05:00
Zuul
49b804c6d3 Merge "Use python3 for pyghmi builds except Wheezy" 2020-01-14 15:38:00 +00:00
Jarrod Johnson
68ef96a624 Use python3 for pyghmi builds except Wheezy
For all supported debian versions, build
python3 pyghmi except Wheezy.

Change-Id: I9271075cf9e088997a9007341b925dbc7cf476d9
2020-01-14 09:38:42 -05:00
Jarrod Johnson
3cb52cedb7 Fix breakage incurred from 'style fixup' changes
The pycodestyle fixes that were submitted broke a few things.
One it removed the utf8 declaration for code that had utf8 in it, breaking python2.

It also introduced a circular import by moving an import to
unconditionally import rather than conditionally import.

Fix these two issues.

Change-Id: Ibfeccd5b649bd597b7f879bb6124d8bbcbc3ec69
2020-01-14 09:19:40 -05:00