2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-13 19:27:48 +00:00

604 Commits

Author SHA1 Message Date
Ilya Etingof
b1efd446e7 Add more file patterns for git to ignore
Change-Id: I4e19a008f236094cd2641279b3660cafb187c8ec
2018-08-10 12:42:20 +02:00
Jarrod Johnson
9e443c8135 Fix notification of custom keepalive on broken
The addition to actively try to logout failed to notify custom keepalive
Have logout() run the same routines that mark_broken did if logged
to have it more consistent and reliable.

Change-Id: I557ce0e8ef856acee5eb52622537e02f7bffe805
1.2.4
2018-08-07 10:57:26 -04:00
Jarrod Johnson
f04f2fd416 Fix console input with unicode
If unicode data comes in, coerce it to utf8 so it can be concatenated
to a bytearray.

Change-Id: Idfefbd8d89a817b3c93daa295c76ab829d2be8d3
1.2.2
2018-08-03 14:37:57 -04:00
Zuul
5b4dc292a6 Merge "Improve pyghmi performance" 1.2.0 2018-07-26 18:50:17 +00:00
Jarrod Johnson
cc32c99916 Improve pyghmi performance
The session.py uses lists and struct liberally.  We can be clearer and
more efficient by just working with bytearrays instead, which are better
fit for this purpose.

Change-Id: I280db9322c9a4f89470d93cf6df56b18966edb51
2018-07-26 13:31:00 -04:00
Jarrod Johnson
779b9be2e2 Abandon a broken session
init can wait forever if a session is going to be broken.

Change-Id: I233e0bffdac58eed7644db0cd17477d45f8ace15
2018-07-24 14:22:44 -04:00
Daniel Speichert
c7da450214 Python 3.7 compatibility: async is reserved keyword
Change-Id: I2f9a1e4fa4bb4d4cf95c2a43039397c9a03ddda8
2018-07-23 16:02:12 -04:00
Jarrod Johnson
50907ea2ca Try to clear presence in initting sessions on broken
If a session goes broken while initting, make sure to clear that.

Change-Id: I38a97af68f5d6bc836f477793f98b703b9ac43ff
2018-07-23 14:14:38 -04:00
Jarrod Johnson
eec5bcf9cd Support default for numeric_data
numeric_data entries have default as an attribute, support this
location for default

Change-Id: I23f8bc23f55e804100e2816536f7d33855fa61d6
2018-07-20 11:33:28 -04:00
Jarrod Johnson
52374d6a30 Print SOL error on broken ipmi session
If we detect a broken ipmi session on send, induce calling code to
do error handling.

Change-Id: I6987a6fc6bf69e8112f6c1735b4332e27b70a2ca
2018-07-19 11:25:54 -04:00
Zuul
571d70edc7 Merge "Provide a grace period for session validity" 2018-07-16 17:52:27 +00:00
Jarrod Johnson
62211a05df Provide a grace period for session validity
If a session has *just* expired, it may just be waiting for the
next timeout pass.  If it expired 15 seconds ago, however, it should
by all rights be beyond dead.

This matters as the calling code may be oblivious to the change of
session object under the covers if this is tripped.

Change-Id: I5be3bafb5932c287eb17c66217ba630746533310
2018-07-16 11:18:38 -04:00
Jarrod Johnson
eb98259f6b Fix build id of FPC
FPC does BCD encode of the build id.  Fix the display.

Change-Id: I921c9cb8cde687ed700bb400dc4081d7f67410a8
2018-07-11 12:49:20 -04:00
Jarrod Johnson
ae0c9782d7 Require python-cryptography
Ensure that rpm based packages carry this requirement correctly.

Change-Id: I0c7c58c9924d2713e6cc5f366beb03cb2e08b618
2018-07-09 09:47:26 -04:00
Jarrod Johnson
3cd94503ff Fix uploads without otherfields
otherfields addition for IMM broke other uploads.  Rectify the mistake
by referencing an empty tuple instead.

Change-Id: I0db752351cfef4ba54cb81b551585ac5aad74f91
2018-06-26 16:57:05 -04:00
Jarrod Johnson
399618df92 Attempt to logout on the way out when broken
Do a no-retry logout attempt, in hopes of mitigating leaving
stray sessions open in various situations.

Change-Id: I750249a69cac2695d8da45780c3b908943148565
2018-06-26 08:52:59 -04:00
Jarrod Johnson
8bd1aeeada Properly pass formname when using FileUploader
There was an oversight where the formname was not properly
passed when requested.

Change-Id: I6a7b95b82bbfcdbd8f7c54261fb09b1b70b9347c
2018-06-19 14:16:12 -04:00
Jarrod Johnson
b649afcb45 Add progress indication to SMM update
Refactor the support added to support IMMv2 RDOC to be reusable, and
apply it to SMM updates as well.

Change-Id: I01cd3dca8b14230c0487e2e7261fde412efedf8d
2018-06-19 11:24:31 -04:00
Jarrod Johnson
dc8d2f3bf6 Add IMMv2 remote media upload
IMMv2 media upload was required, so this implements it.

Change-Id: Idf4ea58c0b01186b2ae646ff428ff952ab72c0ef
2018-06-19 10:25:40 -04:00
Zuul
dfe960d5a3 Merge "Wrap bytes in a StringIO" 2018-06-18 19:12:19 +00:00
Jarrod Johnson
d4cfcd4919 Wrap bytes in a StringIO
Python httplib was making a copy of the data passed as bytes, completely
foiling the memory reduction attempt.  Change to StringIO to avoid
bulk copies and have python httplib itreate a bit at a time.

Change-Id: I923d8bac290f628ee10dd8a33e528a32f3d52a23
2018-06-18 14:31:38 -04:00
Jarrod Johnson
2b2f73788a Restore IMMv2 mount attempts
IMMv2 firmware changed two things:
-It now requires a referer to mount media
-Newer firmware moved from data?set to data/set

Change-Id: I4b5b88f993b87e4e769aad82cb161abfb72bfd18
2018-06-13 15:05:39 -04:00
Zuul
8b25601a7a Merge "Move SOL payload retries to console.py" 2018-06-12 18:27:06 +00:00
Jarrod Johnson
cf4adce3e9 Move SOL payload retries to console.py
SOL packets are treated differently and as such should
interleave with non-console data.  Particularly if SOL payload gets
deactivated by something else, do not presume the whole session to
be broken (leave that to the command based keepalive).

Change-Id: Ic70b57cd6834e6936f1d5a6b855dbe835200ad41
2018-06-11 14:41:28 -04:00
huang.zhiping
680a0c406e fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I5b088566dc6b55e04f5235b789fd71bfee496792
2018-06-09 20:40:18 +08:00
Jarrod Johnson
33beac870d Add specific message for missing media license
XCC error for license was not handled.

Change-Id: I10d2c18cbbba8ea63642bf27020c87cd638414b2
2018-06-01 09:59:05 -04:00
Zuul
2df9280c8e Merge "Migrate from PyCrypto to Cryptography" 1.1.0 2018-05-18 16:23:21 +00:00
Ilya Etingof
fd7fd76274 Migrate from PyCrypto to Cryptography
The King is dead, long live the King!

Change-Id: I2491c2b7e4aebcb9122a16918a2a35caaa580e38
Story: 2002056
Task: 19705
2018-05-18 17:55:56 +02:00
Jarrod Johnson
4404b537fd Error on invalid signature
Provide a more informative error when faced with an invalid firmware
signature on upload.

Change-Id: Ifdc6ae546270509e80c260584951427396b7230e
2018-05-17 13:05:40 -04:00
Jarrod Johnson
e21fdbf1f3 Fix SMM updates on newer SMM firmware versions
Must explicitly declare the type of firmware now, accomodate that
with the request.  Older SMMs will return error that we will ignore.

Change-Id: I8911da94ccbfc5447c2d4902cbbcbd48c87605cf
2018-05-16 16:53:37 -04:00
Jarrod Johnson
6c37f63ab8 More informative message on password expiry
Make it more clear what is happening when password
had expired preventing login...

Change-Id: I63a947cca6749ba12ab2d03e279016b389dc1f30
2018-05-16 14:54:53 -04:00
Jarrod Johnson
5cd53d83ed Fix duplicate adapter name handling
More than one of a given adapter may be a system,
give them unique names in inventory.

Change-Id: If80680241e35aadc4821fc230f85d5b1efab1e51
2018-05-16 14:26:10 -04:00
Ilya Etingof
12a83bc6de add lower-constraints
Create a tox environment for running the unit tests
against the lower bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the
lower bounds in those tests.

Add openstack-tox-lower-constraints job to the zuul
configuration.

See [1] for details.

1. http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html

Change-Id: I0f8b1bd44cd2f401593ce079cdecce5020807051
2018-05-16 15:38:38 +02:00
Jarrod Johnson
c25046b23f Handle missing properties
Missing properties happen on older firmware, return
blank info.

Change-Id: I1972ab95a15ebe86180462158d3ea78a2c3b4a1b
2018-05-15 13:02:55 -04:00
Jarrod Johnson
f8c92bd9de Update to newer hacking
Fix some complaints, mask others for now.

Change-Id: Iba4adf30131724db401fe2ee773975942fd58fd2
2018-05-15 11:39:15 -04:00
Dmitry Tantsur
adb8f1cf56 Do not run functional (API) tests in the CI
These tests exercise Ironic API with the fake driver, thus they provide
no coverage for pyghmi and can be excluded.

Change-Id: If75f60afc3feb900b91a893299eb5f3cc4e6091c
2018-05-07 15:46:04 +02:00
Jarrod Johnson
1eb6577c20 Support '=' as a list delimiter
The ASU utility had created an expectation of = delimiting.

Do not advertise it, but also do not break when faced with that
expectation.

Change-Id: I32c58db3d8be141d50f0d77b85c29371094a8e12
2018-05-03 14:44:26 -04:00
Jarrod Johnson
758507764a Normalize spaces in values and candidates
There are some uefi configuration options that have a confusing yet
specific number of spaces in the setting.  Improve the experience by
normalizing all whitespace to single space in the candidate and
the value to select the correct one that will make it to the system.

Change-Id: I6b3e162fbaff342077bb16ebcdf492a84dd67529
2018-04-20 17:11:18 -04:00
Jarrod Johnson
237cf886ac Revise the FPC fix
It turns out that the root cause for the behavior was subtly
different.  Update to handle the new formats.

Change-Id: I6dbc3793e377d24a6eae6fb97d592dc0813ddf07
2018-04-13 11:13:19 -04:00
Zuul
053d8a8e88 Merge "Check the status for no power permission" 2018-04-12 21:46:11 +00:00
Jarrod Johnson
792e32d243 Check the status for no power permission
It is possible to assert no power permission without providing a
reason.  Check and add the no power permission state explicitly in such a case.

Change-Id: I48b81217405fc63a1d5b4772ab9e338b85d79204
2018-04-11 15:12:39 -04:00
Jarrod Johnson
c39e463c67 Prefer cyrptodomex if present
For compatibility, accept PyCrypto.  However if Cryptodomex is present
(explicit version of cryptodome), use that.

This is an easier path to a modern supported AES implementation that
continues to support older, but still prevalent long term linux
distributions.

Another project required cryptodome, and evidently it caused problems
due to some interoperability with things that truly needed PyCrypto.

Change-Id: I3c0601bc0b6ae56417e712b50337ec1c20eb89a2
2018-03-30 13:30:02 -04:00
Jarrod Johnson
5c5a0269d7 Add hostname for FPC and XCC
Provide access to hostname and dns domain on FPC.  Also, make the
webclient a bit more robust.

Change-Id: I7176adf821a01c5cf7f20cc8227118a6b8dbd4a3
2018-03-30 08:46:22 -04:00
Zuul
3db33fafb5 Merge "Have logged set to 0 early" 2018-03-29 16:09:52 +00:00
Jarrod Johnson
d026898b2f Improve performance of get_health for XCC
Provide a quicker health assessment for XCC.  Generally provide
a way for OEMs to replace or augment or conditionally replace the
generic behavior.

Change-Id: I54c9b9a91aabd6025d17d65846be164b87694019
2018-03-29 09:33:38 -04:00
Jarrod Johnson
91324ec356 Have logged set to 0 early
The logged attribute is not guaranteed to exist, which
can cause certain actions early on to produce a trace.
Make sure it is present and accurate.

Change-Id: Ifb646e60c5fc2880819d21831979e875239a3349
2018-03-29 08:49:24 -04:00
Zuul
e4dd7a9643 Merge "Get additional enclosure data" 2018-03-28 20:09:23 +00:00
Dmitry Tantsur
57128fdb9e Switch the dsvm job to the "ipmi" hardware type
The pxe_ipmitool driver is deprecated and is likely to be removed in Rocky.

Change-Id: I445deb0312fc705632d86a70946f3ddbd52c64ab
2018-03-16 13:12:16 +01:00
Jarrod Johnson
d756743f40 Get additional enclosure data
Newer firmware provides more data about the enclosure.  Use this
to expand the details on the Enclosure inventory data.

Change-Id: I022934e89ae3dc109d7f94da617127c2695b98c7
2018-03-15 16:47:22 -04:00
Jarrod Johnson
ffd9c553ff Ignore small packets claiming to be IPMI payload
A particular BMC had it's wires crossed and sent a stray SOL packet
with the wrong payload type.  We can't do anything to correctly process
said packet without making a pretty wild assumption about it, so drop
it with prejudice.

Change-Id: I96e68a49f55d955cc57c3e52ce70b5932e29680e
1.0.44
2018-03-14 18:55:10 -04:00