2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

695 Commits

Author SHA1 Message Date
Jarrod Johnson
c8135688be Fix string formatting
Error string was incorrectly trying to use '+' to
add number into the message.  Fix by using format

Change-Id: Iedc83383ffa4770b28538895369c9b3d58bb5bad
2019-02-26 10:26:23 -05:00
Jarrod Johnson
1575928d03 Support updating multiple adapters
Add support for updating multiple adapters.

Change-Id: Idafaa9896cdf6c4da100016ea033c31749ce0bde
2019-02-22 16:32:28 -05:00
Jarrod Johnson
9c4991a747 Generalize the megaraid check
The megaraidconfigurationtool may be branded a few different
ways.  Mask all of them.

Change-Id: Ie0c056a0467eb118500be59a270e5940c3c94529
2019-02-21 13:27:41 -05:00
Jarrod Johnson
d065f22324 Treat thorn as string terminating
While a thorn in theory could be valid,
in practice the more likely intention
is yet another nonstandard string termination
attempt.

Change-Id: I71f837725b1e286b9f94786aa520deb12ce208e4
2019-02-20 13:36:17 -05:00
Jarrod Johnson
57d4db40ca Improve consistency with Lenovo tools
Lenovo tools use mriName to label configuration groups.  Change to this
by default, while retaining legacy name
as alias for backwards compatibility.

Change-Id: I220ab18e21947745cf942d78536668d580ffa38b
2019-02-20 11:14:16 -05:00
Jarrod Johnson
d88b508e71 Suppress Avago RAID config
The storage configuration interface is more appropriate
and other tools mask these settings.

Change-Id: I02bd935e68beb63ae725eb45cb062604377f26bd
2019-02-20 09:22:21 -05:00
Jarrod Johnson
ddf12b6b58 Refresh token between verify
The first verify phase may be delayed,
and in such a case could straddle bad
timing of the token expiry.  Refresh
between the phases to mitigate risk
of expiring the token in the middle of
running.

Change-Id: Ia96fa8824a2e9e8eff8fd2d353b1b0bc7fa710a7
2019-02-19 13:28:10 -05:00
Jarrod Johnson
72138e7e56 Fix vague KeyError exceptions
If the XCC/IMM bails out in the midst of an update,
it was inducing a vague result.  Rework to be more
specific in the error.

Change-Id: Ie35735cc2581e7bcd7a0f4484650366d37ea613d
2019-02-19 10:44:25 -05:00
Jarrod Johnson
97be31ca95 Support ordered default setting
An ordered setting (e.g. bootorder) requires
different handling.  Support it by the appropriate modifications.

Change-Id: I5b8931f3b034ee8f48285797bec4a4016a5fecc5
2019-02-12 10:08:43 -05:00
Jarrod Johnson
bc8deb4b68 Fix git copy in builddeb script
The builddeb script attempted to build in a directory
without .git, breaking the version deterimination logic.

Change-Id: Ia2be3a75bdcdf9335586bb40e05e635f4b497ca5
2019-02-11 09:52:33 -05:00
Jarrod Johnson
9fa2095fe7 Update the Wheezy patch
The patch had a lingering incompatibily to address.

Change-Id: If7d23efbfdb7cfa2400920e5b9ae04282e66a9a7
2019-02-08 15:22:53 -05:00
Jarrod Johnson
90a9be1344 Be compatible with wheezy python
Debian wheezy has a python vintage that
errors on unpack from a bytearray.
Explicitly cast to bytes for unpack
to compensate.

Change-Id: Icaf3931a905102e6ee6ef03d91617c031a1afc86
2019-02-08 14:31:54 -05:00
Jarrod Johnson
3e65ed0189 Workaround wheezy limitations
Debian wheezy is just too old to easily work with,
for that platform, use the more amenable
cryptodomex library.

Change-Id: Ic21d9784158d9d3f529d8c17dbe60a49f244cc7c
2019-02-08 13:08:49 -05:00
Jarrod Johnson
3b7d79c5fc Directly reference packages in pbr-free setup
Without pbr, the list has to be manually curated.
There is a setuptools directive that will work and
is used by pbr, but for now use the output with some
modules trimmed.

Change-Id: I772b7bef263639167b3b5c54bc7812e1e8acbaf6
2019-02-07 14:29:49 -05:00
Jarrod Johnson
1721f7b237 Fix typo in the setup.py template
The template for non-pbr builds had a mistake.

Change-Id: Ic79bf1dcbbe851c5664f95cf3cb26f3251d73b35
2019-02-07 10:55:04 -05:00
Zuul
06b8ab4193 Merge "Enable package builds without pbr" 2019-02-04 21:28:47 +00:00
Jarrod Johnson
40c546400e Enable package builds without pbr
There are some build environments we are being asked
to support that pbr does not.  A quick fallback
to handle such environments.

Change-Id: Ie5dac2555c73e80e4cf589932a18f31a530bdf65
2019-02-04 15:59:18 -05:00
Jarrod Johnson
4337179d7e Fix break handling in SOL
When the retry logic was moved to console, it exposed a problem with
the sol handler being called in the midst of transmitting without
clearing the pending payload, resulting in an infinite recursion
of sending the same break.

Resolve by using the common call to sendoutput to have it occur
only after the current head of pending output has been removed.

Change-Id: Iaae86a3bd870c1841530e200ef0f5780a5cc6993
2019-02-01 09:18:12 -05:00
Jarrod Johnson
2c901ac471 Enable SMM user for web access
SMM may not allow a new user to access web.  Make the user_access
extensible and use that to have web privilege follow the ipmi
privilege.

Change-Id: Ib08e0064b3fb402de833a159c471e28579520a5d
2019-01-31 14:12:30 -05:00
Jarrod Johnson
c0d8e2a12c Add UEFI/BIOS configuration to pyghmi redfish
Change-Id: Ie1a697eaf136f75007838d85bf877a262318fd5b
2019-01-28 16:43:44 -05:00
Jarrod Johnson
bd12cd646d Fix lenovo generic fallback
Wrong number of arguments are sent in such a case

Change-Id: Icbb56b8d3ef227e1a00baeedf236bf321841fabf
2019-01-25 09:54:32 -05:00
Jarrod Johnson
eccbf6193b Implement more robust handling of config.efi
XCC may be transiently unable to provide the UEFI configuration.
Implement a retry if the XCC reports that it does not exist.

Change-Id: If0d5f1136087d60b9f834f7970a59f0af61336c3
2019-01-24 10:09:17 -05:00
Jarrod Johnson
6d9a4b98d8 Ensure XCC health sets general level
In the event of an event that is not modeled by the IPMI sensors,
make sure that at least the health summary is correct.  Add in
a known condition that is missed by IPMI sensor modeling for detail
as well.

Change-Id: I207e137c49b4321cf4040188a84de569f55c5707
2019-01-23 10:24:52 -05:00
Jarrod Johnson
f4e3f62ef2 Reduce assertion of bootable media failure
This is almost always a false positive.

Change-Id: I7738f42dd903834f5388ac85d3f049fc95316fd6
2019-01-22 14:12:36 -05:00
Jarrod Johnson
cad67cf751 Add support for XCC License key management
XCC features are managed in keys, support management of those keys.

Change-Id: I10a1e55dd6705cebacb8c49c98f19491bdf9e2d0
2019-01-14 13:53:12 -05:00
Jarrod Johnson
534963553b Avoid stale webclient in XCC client
XCC aggressively ages out a session.  Check last
token refresh before deciding a session is viable,
discarding it if it is too old.

Change-Id: I490263edb4b2a8ddbd91d6b236d4a7e689f410c7
2019-01-11 16:32:46 -05:00
Jarrod Johnson
872f53ab0a Improve error on unexpected scenario
When doing a firmware update, a surprise flow leads to a potentially
misleading exception.  Change to be more clearly obvious that there
is confusion.

Change-Id: Ib9aa2c0f357daf5af0462062733c2c83c7e25079
2019-01-11 11:39:05 -05:00
Jarrod Johnson
7002c1e8f3 Refresh token during validation
XCC may take a while validating, and the token must be
refreshed to avoid chance of expiry.

Change-Id: I0e78008dba6bc214876ca286989b01d2f89733bb
2019-01-10 13:15:40 -05:00
Jarrod Johnson
520b7dbeca Add M.2 Drive Firmware
M.2 drive firmware is held in a different area in the API.  Provide
that data along non-M.2 drives.

Change-Id: I94b85687b2f22bc45d6e37c9da855f7bbd426c2f
2019-01-08 19:07:18 -05:00
Jarrod Johnson
9515a4f7e0 Add OEM support for XCC PSU information
The XCC provides more detailed information.  Augment the inventory
and firmware commands with this information.

Change-Id: Ib2cedc4176f18d82eea3a2a156ac3c7e5a16f3eb
2019-01-07 15:52:40 -05:00
Jarrod Johnson
b810b02b1e Begin redfish implementation in pyghmi
This provides support for the redfish standard.

Change-Id: If2115f612c0f7d352361c31ad1958c102b70b6fc
2019-01-02 15:55:20 -05:00
Jarrod Johnson
ebf33d40bf Restore support for old XCC update API
Oldest XCCs return different data to unsupported APIs, so
modify to support three variants, no return, return 2, and
the latest that require support for the return code.

Change-Id: I8d04cfffa42ff9b70bd4a19e32b353c0c7be5544
2018-12-14 08:07:30 -05:00
Jarrod Johnson
db7f1490f5 Support newer FPC CSRF scheme
CSRF scheme was refactored in recent FPC firmware, support the third
location where the CSRF tokens might be found.

Change-Id: I0a3a9310e399f77d2a40f4b9d815127b9a884d1d
2018-12-12 15:59:59 -05:00
Jarrod Johnson
da5e602cb0 Add support to persist SDR cache to file
This allows a project to persist the frequently expensive SDR
cache run to run.

Change-Id: I8208edec3178fb229db0572b17f4b161ca6d8d1d
2018-12-12 09:28:27 -05:00
Zuul
0cf4cd467b Merge "Share SDR repository info" 2018-12-11 21:13:43 +00:00
Jarrod Johnson
f2a8753a99 Share SDR repository info
This avoids having to fetch SDR for every since instance when
many instances have common SDR.  This improves first-run performance
and reduces memory consumption.

Change-Id: I1283297b8f4635e096af962fa1a49d4c752e80ec
2018-12-11 15:39:32 -05:00
Jarrod Johnson
871316c967 Correct mistake with refactoring JSON calls
The arguments were incorrect.

Change-Id: If1738c6d877b72bf71b28a643042ad3542de9866
2018-12-11 08:52:08 -05:00
Jarrod Johnson
1dc3844ea8 Support empty successful scenario
redfish has a concept of 'no news is good news', and firmware is
changing to use that.  Support both old and new behavior.

Change-Id: I1b85359ee1236c7ad5f26b67640415839ad1073b
2018-12-10 13:37:27 -05:00
Jarrod Johnson
58108b2e5d Fix omission in new API
Do not report a problem on verifystate==1.

Change-Id: I38470f3c0c9b621f45248c0302e562ec33ccd554
2018-12-10 08:27:26 -05:00
Jarrod Johnson
bff08bbe60 Support upcoming XCC update API
Upcoming XCC firmware update has an additional step to support in
order to successfully perform an update.

Change-Id: I08e1fccd25d40b290bbd818bdb57ef74131e76f7
2018-12-07 16:43:52 -05:00
Jarrod Johnson
4f74d4c4f9 Allow SMM downgrade
Call API to allow downgrades when going to apply firmware.

Change-Id: I7953929ef5cb2aa410feeb7dba9d679d5c8ced6b
2018-12-06 15:10:32 -05:00
Jarrod Johnson
3bf7fc543f Fix formatting of SMM/FPC version
The SMM/FPC standard format is 0 padded.  Implement
this in pyghmi.

Change-Id: I21a58678968e7129278bf1fb3ffeb8391e07a4e8
2018-12-05 15:20:21 -05:00
Jarrod Johnson
40a1600f3e Add FPC/SMM description
The get_description call will now help describe the height of current
Lenovo dense portfolio chassis.

Change-Id: I7d7f53b71360f3e2227c08a06cac03ac0d407210
2018-11-14 14:30:13 -05:00
Jarrod Johnson
84924a1f5c Fix python3 incompatibilities
The python3 http support has some differences from python2.  Provide
compatibility for both python 2 and python 3.

Change-Id: Idb8d5815b0a540fc7ae4183bd033a2725d889930
2018-10-30 14:42:01 -04:00
Jarrod Johnson
2367c85f25 Preserve logout on storage failure
If the storage call should fail, carry on logic to allow the situation
to clean out.

Change-Id: I325c0870bdc2ff358ed872697c15b5963ca836a0
1.2.16
2018-10-26 15:44:57 -04:00
Jarrod Johnson
a7db8615aa Fix storage deletion
When multiple controllers are present, it is required to
specify the controller number.

Change-Id: Iab8e7a44c1bcdb65c682c2cd9b9629206300ecd1
2018-10-25 16:29:11 -04:00
Jarrod Johnson
c716dca665 Have storage functions log out of the session
The storage functions were not leaving the web
session viable after a time.  Correct by having
the storage functions logout on completion.

Change-Id: If0ccc40d0525de4a4f3690be478bd5fb0d7dcd3c
2018-10-16 10:09:11 -04:00
ghanshyam
dca0e4001c Gate fix: Cap hacking to avoid gate failure
hacking is not capped in g-r and it is in
blacklist for requirement as hacking new version
can break the gate jobs.

Hacking can break gate jobs because of various
reasons:
- There might be new rule addition in hacking
- Some rules becomes default from non-default
- Updates in pycodestyle etc

That was the main reason it was not added in g-r
auto sync also. Most of the project maintained the
compatible and cap the hacking version in
test-requirements.txt and update to new version when
project is ready. Bumping new version might need code
fix also on project side depends on what new in that
version.

If project does not have cap the hacking version then,
there is possibility of gate failure whenever new hacking
version is released by QA team.

Example of such failure in recent release of hacking 1.1.0
- http://lists.openstack.org/pipermail/openstack-dev/2018-May/130282.html

Change-Id: I5f17ec6f67c7e7addfc5b2b2a3f17719402d9c0b
2018-10-16 11:43:37 +00:00
Jarrod Johnson
78cbbb4ee5 Handle response without unconfiguredDisk
Some adapters do not provide this information explicitly.  Handle
this discrepency by defaulting to an empty list.

Change-Id: I72c2e83a78c821e1d790972b253e9d7026a5f7ad
2018-10-15 16:11:30 -04:00
Jarrod Johnson
d28955e3ef Fix early life mark_broken call
If mark_broken called early, it would incorrectly
fail due to self.socket not existing yet.  Address
this by ensuring the attribute exists earlier and
ignoring the pool accounting if socket is not yet
assigned.

Additionally, fix a problem where the callback for
console could happen before console actually had
the ipmi_session attribute.

Change-Id: Idb93ca23d4a43760698bdc55d19418210daa7a62
2018-10-12 15:17:48 -04:00