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
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
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
It was incorrectly trying to abbreviate names that
are already short enough, causing a problem for certain
name lengths.
Change-Id: Iebb977bef3db0131cad3d923f5943f9bfa9247a6
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
To have python 2 act more like python 3 and look
like python 3, make range = xrange where xrange exists.
Change-Id: I9918604a619f33682aee3b9896a3bb6afcd8aa8d
When error encountered, we still need to consume
the response with rsp.read(), or else a subsequent
request will fail.
Change-Id: Ica4f69cadf32a204af3e69a1ee6d336e08f7fc78
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
Python 3 does not implement buffer. Use memoryview
as a standin if buffer would induce a NameError.
Change-Id: Id36e8253fffee9dc22bd982e00554f1c25bc95b4
FPC PSU status reporting requires OEM commands. Provide
OEM to pyghmi sensor model translation. to enable normal
applications to read it.
Change-Id: I63b950db7ffa5a5a2ba2ed3a2f2be33a53221b03
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
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
When a system did not have any custom keep alive, the
code to mark the esssion broken erroneously tries to
dereference.
Change-Id: Ic4efe3c65ee4c09c97ef9f08dc30603c4c15d872
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
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
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
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
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
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
Thinkserver SD350 chassis identify command does not implement
indefinite activation. Work around by using an OEM command that
does manage that.
Change-Id: Ic83c42ac39dd18fb6c51d025d1c0c58d75161637
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
The spec [1] is trying to support nmi, so that
we should also enhance bmc to support it.
[1] I3dc6561ea7cecf8b8d998717fefa9cf8001d0f4c
Change-Id: Ib7465ace5b370b31dab5334a34f7216170e1ff2b
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
Older IMM systems have a slightly different structure. Tolerate by skipping the
extended storage data when not available.
Change-Id: Ifc5b9de0e87ceb648c3045b357af434b9e8288e5
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
xraw_command is the version intended to be lazily
used, switch to that version to make the SDR code
more robust.
Change-Id: I1e9b799dd21861fa602db6a1d474334e88915c38
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
M4 systems do not support agentless, but return
data differently. Avoid generating an exception
in this scenario.
Change-Id: I2da1fb67d12a71249ba5e3b6be93a57ba66fcab6
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
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