2
0
mirror of https://opendev.org/x/pyghmi synced 2026-04-01 15:53:32 +00:00
Commit Graph

938 Commits

Author SHA1 Message Date
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
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