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

426 Commits

Author SHA1 Message Date
Jarrod Johnson
4fcc75899e Consolidate IMM date string parsing
Various strings/date formats may be used
in different places, and in fact the same place.
Use a consolidated catch-all parser to convert
the strings to a datetime.

Change-Id: Ie84229056ba55806bce1527ea263a80c29ff7048
1.0.13
2016-11-15 10:45:26 -05:00
Jarrod Johnson
2cfec95558 Ignore KeyError on delete of missing sensor
The duplicate sensor code can result in an id that never
gets added.  As such, do not worry if trying to delete
something that is already not there.

Change-Id: I77af1054097d4225ad8bff68a046c6ed28791e9b
2016-11-04 09:45:48 -04:00
Jenkins
563b15decf Merge "Implement IMM remote media mount" 1.0.12 2016-10-31 13:31:17 +00:00
Miles Gould
b6cac4cc46 Fix bullet points in README.md
Each line was getting its own bullet point, leading to bullet points in
the middle of sentences. This patch removes the excess bullet points.

Change-Id: Ifb3a5e66fe6796236efe46e4dbda0ee2e89b0fcc
2016-10-28 13:57:44 +01:00
Jarrod Johnson
fd92a734be Correct mistake with image name abbreviation
It was incorrectly trying to abbreviate names that
are already short enough, causing a problem for certain
name lengths.

Change-Id: Iebb977bef3db0131cad3d923f5943f9bfa9247a6
2016-10-27 14:11:13 -04:00
Jarrod Johnson
932087b5a6 Implement IMM remote media mount
New IMM firmware provides a mechanism to
specify a mount by URL.

Change-Id: Ib8575bd9fe6e81f0a3880f39a319e4fc53d15aef
2016-10-27 08:43:17 -04:00
Jarrod Johnson
a27d28fb0a Recognize and use CSRF token
Newer versions of IMM firmware implement a mechanism to guard
against CSRF.  Use the provided token via custom header to prove
that our requests are not CSRF.

Change-Id: I6cc030302ecacdfedc8e2fcf6e7588a82db957e7
2016-10-25 14:22:29 -04:00
Jenkins
87be4c8a41 Merge "Have range become xrange where available" 2016-10-12 17:17:02 +00:00
Jenkins
cfe511a594 Merge "Add script to help build rpms" 2016-10-12 16:45:07 +00:00
Jarrod Johnson
d76301be95 Have range become xrange where available
To have python 2 act more like python 3 and look
like python 3, make range = xrange where xrange exists.

Change-Id: I9918604a619f33682aee3b9896a3bb6afcd8aa8d
2016-10-12 12:38:11 -04:00
Jenkins
f354a3cc2c Merge "Fix webclient viability after error" 2016-10-12 15:26:04 +00:00
Jenkins
afdb132ac0 Merge "Check for buffer and use memoryview if missing" 2016-10-12 15:06:48 +00:00
Jarrod Johnson
66e0b916e4 Fix webclient viability after error
When error encountered, we still need to consume
the response with rsp.read(), or else a subsequent
request will fail.

Change-Id: Ica4f69cadf32a204af3e69a1ee6d336e08f7fc78
2016-10-12 10:48:08 -04:00
Luong Anh Tuan
cd5e8a1a88 Remove xrange for run both Python 2 and Python 3
In python 3, range() does what xrange() used to do and xrange() does not
exist. If you want to write code that will run on both Python 2 and
Python 3, you can't use xrange().

range() can actually be faster in some cases - eg. if iterating over the
same sequence multiple times. xrange() has to reconstruct the integer
object every time, but range() will have real integer objects.
(It will always perform worse in terms of memory however)

xrange() isn't usable in all cases where a real list is needed.
For instance, it doesn't support slices, or any list methods.

Change-Id: I15369a8b9335f5221a52d292a4aa1e36a0850b8f
2016-10-12 12:40:46 +07:00
Jarrod Johnson
dad54d5db5 Check for buffer and use memoryview if missing
Python 3 does not implement buffer.  Use memoryview
as a standin if buffer would induce a NameError.

Change-Id: Id36e8253fffee9dc22bd982e00554f1c25bc95b4
2016-10-11 11:09:08 -04:00
Jarrod Johnson
3f4185fa60 Add script to help build rpms
setup.py bdist_rpm is not very good.
Instead, provide a script to create an rpm.

Change-Id: If6773ee4938e981a14c38e4e4eabad6b5cb2b6ae
2016-10-11 11:08:06 -04:00
Jarrod Johnson
aee3ae36b0 Extend FPC status
FPC PSU status reporting requires OEM commands. Provide
OEM to pyghmi sensor model translation. to enable normal
applications to read it.

Change-Id: I63b950db7ffa5a5a2ba2ed3a2f2be33a53221b03
2016-10-04 10:18:20 -04:00
Jarrod Johnson
e52c0e3405 Improve SOL responsiveness
In a multi-SOL multiplex case, keepalives could
bring the whole thing to a grinding halt.
Fix this by having a way to request raw_command do
'waitall', which is really just running wait_for_rsp
recursively, as used to happen.  This is not done by default
as for normal synchronous requests, it is a much more expensive
approach at scale.  Reserve it for the special case of wait_for_rsp
which should not hang up on any one response going south.

Change-Id: If8890bf959c2376f58c2b36f0445a5b800280b2b
1.0.11
2016-09-16 16:01:43 -04:00
Jarrod Johnson
77d7d373c3 Handle disconnect notification without session
If session no longer exists, do not try to manipulate it's keepalives.
Remove instances of calling the function where it would be redundant.

Change-Id: I2011f8012175ef12ce83eb34fbf4de9650fb157e
1.0.10
2016-09-14 15:18:18 -04:00
Jarrod Johnson
c35781d4cf Fix error behavior when target has no SOL session
When a system did not have any custom keep alive, the
code to mark the esssion broken erroneously tries to
dereference.

Change-Id: Ic4efe3c65ee4c09c97ef9f08dc30603c4c15d872
2016-09-14 13:02:26 -04:00
Jarrod Johnson
657b75cc86 Fix multiple console object behavior
Software could end up creating duplicate console
objects.  Try to adapt by assuring only the most
recently created one is the sol_handler (by using
existing sol_handler to reach old instance).  Also
unhook a keepalive when we go broken.  When the ipmi
session breaks, notify all custom keepalives active,
rather than just the one currently holding SOL session.

Some of these changes in principle may be duplicate, but
it should be more robust this way.

Change-Id: Id8d3869917de3db723a4b6a79e02643345111b3a
2016-09-13 09:18:21 -04:00
Jenkins
b9dde55f49 Merge "Tolerate client reuse of UDP ports" 1.0.9 2016-08-30 18:33:58 +00:00
Jarrod Johnson
e6bad76e94 Tolerate client reuse of UDP ports
If a system runs many ipmi clients, over time
it may reuse UDP ports.  We currently take this
as a sign of an established relationship in
the same manner we have client to server, but
here clients can be ephemeral.  Cope by
clearing out the current session state
and allowing a new session to come alive.

Change-Id: I2496716d535354616461460f47196d733cde1a87
2016-08-30 13:04:49 -04:00
Jarrod Johnson
d912882c35 Fix errors in IPMI server
If a client used a non-zero IPMI sequence
number, honor the number and separate it
from the LUN.  Also, start session sequence
number at 1 when session is established.

Change-Id: Ife4a03965185160b31e5ca70d455db0e301c4d6f
2016-08-30 09:39:39 -04:00
Jarrod Johnson
f142843bca Fix BMC compatibility with Python 2.6
BMC would try to push a bytearray at unpack.  In
python 2.6, this does not work.  Explicitly denote
changing to bytes to be compatible with python 2.6

Change-Id: I1c919a0050cae9f90c50d89abb6a77774db81381
2016-08-29 16:27:49 -04:00
Fabio Dassan
b60810b4c1 Fix raid driver bitmask
The bitmask used to parse the raid driver parameters was reading a wrong
byte for device state entry. Now this problem is fixed - a new entry was
added (ControllerIndex).

Change-Id: I877075f38737ebd386d3b2c18f5ae4ec7dd3d6f2
2016-08-19 14:54:39 -03:00
Jenkins
faa2ab80a4 Merge "Declare strings explicitly as binary" 2016-08-17 12:18:27 +00:00
xiexs
b1658dacba Support NMI in bmc
In the fix Ib7465ace5b370b31dab5334a34f7216170e1ff2b,
we used cold_reset() as NMI, but it is not correct.
According to [1], we should add a new interface to handle
NMI.

[1]https://sourceforge.net/p/ipmitool/source/ci/
   9caa78be38f2bdf1f3c03571f0c7310a1cb486b7/tree/
   include/ipmitool/ipmi_constants.h

Change-Id: I711053704d27a74a29bb6f50ca85666dd2049d65
2016-08-17 03:01:33 -04:00
Jenkins
4508378650 Merge "Implement identify workaround for ThinkServer SD350" 2016-08-15 14:47:01 +00:00
Jarrod Johnson
613222cdf9 Implement identify workaround for ThinkServer SD350
Thinkserver SD350 chassis identify command does not implement
indefinite activation.  Work around by using an OEM command that
does manage that.

Change-Id: Ic83c42ac39dd18fb6c51d025d1c0c58d75161637
2016-08-15 09:29:57 -04:00
Jarrod Johnson
6bbf650031 Declare strings explicitly as binary
Python 3 requires that strings be explicitly
declared as binary if they need to be treated
as such (implicit strings are unicode rather
than ascii)

Change-Id: I17e5d2ef44ffc106c94b95247585130b07d44417
2016-08-12 14:27:12 -04:00
xiexs
4f16d79001 Supports cold reset in bmc
The spec [1] is trying to support nmi, so that
we should also enhance bmc to support it.

[1] I3dc6561ea7cecf8b8d998717fefa9cf8001d0f4c

Change-Id: Ib7465ace5b370b31dab5334a34f7216170e1ff2b
2016-08-03 00:05:52 -04:00
Jenkins
ff29df14ed Merge "Disable futile attempts to correct uncorrectable time" 1.0.8 2016-07-15 12:42:55 +00:00
Jarrod Johnson
657608ca60 Implement Python3 compatibility
Do strictly the changes associated with
supporting Python 3, no functional changes.

Change-Id: I8b12d48504b67b3a51f3d114d0d3c371b67dc9b4
2016-06-21 13:00:29 -04:00
Derek Higgins
98798b2372 Convert data tuple to a list
The data parameter is defaulted to a tuple, to avoid a TypeError
this needs to be converted to a list before it can be concatenated
with another list.

Change-Id: Iba42196e9f9b9315b684a5ceadf16313f13fdd25
2016-06-21 10:58:48 +01:00
Jarrod Johnson
8ac1385f3c Correct firmware inventory issue on IBM M4 servers
Older IMM systems have a slightly different structure.  Tolerate by skipping the
extended storage data when not available.

Change-Id: Ifc5b9de0e87ceb648c3045b357af434b9e8288e5
1.0.7
2016-06-02 14:06:26 -04:00
Jenkins
ab08846805 Merge "Raise incurred exception if appropriate" 1.0.6 2016-05-25 23:35:23 +00:00
Jenkins
d550969f1c Merge "Fix FPC detection for Lenovo Nextscale" 2016-05-25 23:21:59 +00:00
Jarrod Johnson
b7a789b71b Raise incurred exception if appropriate
While fetching eventlog, if a communication problem
occurs, the exception was ignored and code fell through
to unitialized variable.  Fix this by raising if not the
value known to be ignored.

Change-Id: I7785d0b3695abd84a8cac23059c031956877db58
2016-05-25 16:49:07 -04:00
Jarrod Johnson
413e3c0d32 Fix FPC detection for Lenovo Nextscale
Removing the errant FPC id messed up detection of
real FPCs.  Fix the mistake.

Change-Id: I3fb23979429c98e5c20d5c54dbe915175b670ed4
2016-05-25 16:29:04 -04:00
Jarrod Johnson
eb86ea1ff8 Fix KeyError due to lazy use of raw_command
xraw_command is the version intended to be lazily
used, switch to that version to make the SDR code
more robust.

Change-Id: I1e9b799dd21861fa602db6a1d474334e88915c38
2016-05-25 15:06:06 -04:00
Jenkins
d672a82a19 Merge "Remove support for py33/py26" 1.0.5 2016-05-18 12:42:47 +00:00
Jarrod Johnson
9c14606aba Disable futile attempts to correct uncorrectable time
When an anomaly is detected that suggests the event timeline is
uselessly corrupt, abandon all attempts to correct older entries
and skip or verbatim translate remaining time entries.  The notable
scenario is when an older event has a higher timestamp value than
a newer event (time went backwards, or pre-init to normal) without a
clock sync notification to navigate the change.

Change-Id: I31aa9cd04e20fbdb55d7b955db6f6640da9c75a7
2016-05-18 08:41:42 -04:00
Jenkins
622f401f27 Merge "Remove errant IBM nextscale id" 2016-05-17 14:15:43 +00:00
Jarrod Johnson
b9972f684d Remove errant IBM nextscale id
It erroneously matched an M4 *node* rather than FPC.  Avoid
by not listing the errant ID.

Change-Id: Ieb4947658f65a3e9e8063b2d02e0705c03d690b1
2016-05-16 16:09:34 -04:00
Jarrod Johnson
c794fc3780 Fix agentless error on M4 systems
M4 systems do not support agentless, but return
data differently.  Avoid generating an exception
in this scenario.

Change-Id: I2da1fb67d12a71249ba5e3b6be93a57ba66fcab6
2016-05-16 16:04:42 -04:00
Jarrod Johnson
66f50082c2 Add node status checks to FPC sensors
In nextscale, the FPC has some potentially useful data
about node state with explanation.  Model those as
sensors that may appear in nodehealth

Change-Id: I9dd64740c4934d53d577defe9f3cc7b7a61dc499
2016-05-12 16:29:22 -04:00
Jarrod Johnson
941486e6f8 Add Nextscale total power capacity as a sensor
This indicates the sum of power made available by currently installed
and functional PSUs.

Change-Id: Ic8843cba8f58ce0ec3e6ac62a6c8f9a56374b2a8
2016-05-12 11:19:47 -04:00
Jenkins
461e3dd647 Merge "Extend session keepalive" 1.0.4 2016-05-11 19:07:46 +00:00
Jarrod Johnson
8833dcb817 Extend session keepalive
Since the keepalive is retried, there's no reason to try
to be as frequent as half the specified interval.  The
spec allows inactivity timeout as short as 57 seconds, so
the keepalive interval is extended to 50-55 (allowing some
room for retry to hit in case of dropped packet).

Change-Id: I3b08f2cad1f319759cd0cc54a8793ec16d88d82e
2016-05-11 13:24:33 -04:00