A per instance copy of data was kept in scope throughout download
process. Minimize that to once regardless of instances, and have
lifetime of the extra copy be very short.
Change-Id: Ife3c7f83bf9b97925cf079597f014db648b227ba
The stray progress call and/or unexpected token expiry resulted
in failures. Consistently logout on completion or abortion of process
as well.
Change-Id: I862036962cc83e31b2f426a9c7572325da173586
XCC is structurally the same, but vocabulary changed.
Adjust by abstracting vocabulary at the class level.
Change-Id: I7352f089683bbabdb87d86d87a7f399cd8241fc4
At some point, bmc_handlers was mispelled, affecting graceful handling of
detecting a broken port. Correct the mispelling.
Change-Id: I80e86b9d98fb211a3f1195658b93eaa5a2e88c61
For IPMIv2 sessionless data, there is not 13 bytes
to strip out, but instead only 2. I suspect because
reading the sample packet, the last row unique values
were added without looking at the context. Correcting
for context, the IPMIv2 header is only two bytes longer.
Change-Id: I9b99417c39f519dfa68b59a90a3ef7ca0232e97e
A new set of credentials would break existing sessions.
Support concurrent use of multiple users/passwords, since
there are valid use cases.
Change-Id: Ic63364f05ec9270e06656d13bbb02d7c88fd21d4
Multi-thread application like virshbmc can break
Session.keepalive_sessions and Session.waiting_sessions
with their concurrent operations.
This patch adds exclusive locks to avoid the problem.
Change-Id: I191ed066f02fd329da5a210e2383fa72481916ef
Multi-thread application like virshbmc can break
Console.pendingoutput with its concurrent operations.
This patch adds an exclusive lock to avoid the problem.
Change-Id: I776c2a09069e4af129c865acc1bf47ba021b4e39
protect() handles exclusive locks. It can be used as a context
manager and as a decorator. Multi-thread applications like virshbmc
require exclusive locks to protect list operations and references.
Usage:
import threading
from pyghmi.ipmi.private import util
LOCK = threading.Lock()
@util.protect(LOCK)
def foo():
...
or
def foo():
with util.protect(LOCK):
...
Change-Id: I96eb1fac17a519b4e864731f4fa0285ccc2edb08
This patch adds a BMC-side SOL-related class and methods:
console.ServerConsole:
Sub-class of console.Console for BMC
bmc.Bmc.is_active():
returns whether the BMC is active
bmc.Bmc.activate_payload():
activates SOL session
bmc.Bmc.deactive_payload():
deactivates SOL session
See bin/fakebmc and bin/virshbmc for examples.
Change-Id: I0e649ee0e2b45824a34c9634b00fd4f94c46c8de
Pep8 check is necessory for our code, it also makes your
code easy to readable and understandable and beautiful.
Change-Id: I4bb8434db07bf8fe82a4f65dfdfe7f2114b00083
Closes-Bug: #1699298
If a caller does not do a keepalive, but instead
creates new Command objects or similar, accomodate
by ditching the session that was not kept alive
rather than trying to use it.
Change-Id: I94fba08e3b2c03862b053c11aa3ee6b810db6f21
By raising it in the callback, another thread doing wait_for_rsp
might get hit by it. Store the message and then raise in __init__
so that it lands in the correct vicinity.
Change-Id: Id450a4a3f6194d95bb0eac971e0586525c49e490
For channel 0xe, we can skip checking if the channel
is active, since, obviously, we are connected to that
channel. Since *current* active channel cannot be
inactive, assume that is good if seen.
Change-Id: I894bd27e6c76bb9ace0959566117ad6a6f8866ad
The dictionary size can change, causing this loop to
fail. Fix by wrapping the iterator in a list prior to
iterating.
Change-Id: I67dd5b8b69698e67d6fd07ab18114ce144999d7a
Sending a udp datagram doesn't block long enough to be bothered. On
the flipside, the filehandle sharing can throw eventlet for a loop in
some environments and circumstances.
Change-Id: I2d6f8b79f0e49c5f21b3b0cf1b9956443ece7eea
Circumstances are such that sometimes a BMC
logs being in setup at a time when it is
not strictly 'entering'. Change wording
to be less specific.
Change-Id: I5863b07640df2a32ff5b1056f20d034fa86c0ae7
Web connections were defaulting to infinite timeout. If
a problem happened in the midst of a connection, a request
could hang things indefinitely. Add a 60 second timeout
to purge these situations.
Change-Id: Ica05e2bfb9242ccc564e39c8631d8bf7e3f230a5
This is a subset of pyghmi functionality for use in dealing with BMC
over KCS or similar Linux driver supported IPMI access through
/dev/ipmi0
Change-Id: Ifeb3935cbb3c95e7871b74a2b42e59e71ecb6697
Another firmware change becomes sensitive to the value of referer.
This adds the same referer header value that would occur naturally from
a browser.
Change-Id: I20928bbd88a4df281f9fb4f7cc472419a6059f09
Some BMCs appear to expire a session within 30
seconds, unfortunately.
Also, be careful to always fire events, even if the remote has gone away.
Change-Id: I1b57fa8841ca19c77d36abe3ccc5bf877e09945a
When an reading is unavialable, a distinct set of
attributes were available. Correct this by at
least having the same attributes available.
Change-Id: I9fc351d804f638a2535a2c9be9d9e9929f2be6ba
Some implementations offer device SDRs, but also
SDRR. For such cases, gleefully ignore the device SDRs,
and move the 'needs implementing' down to a scenario where
it could both work and would be needed.
Change-Id: I2219ba7407f2e0030817d93f394657266e70deda
Rearrange things such that in the future, distinct generations
of IMM that are very similar may be supported with common
code through inheritence while deviating in the ways that are
needed.
This also removes the redundancy of registering the certificate
callback in the OEM layer and standard layer and instead just
has it in the standard layer.
Change-Id: Ic386553d080163ed63b6e4f2294839654e377269
This patch is changing the IpmiServer and Session classes to figure out
which IP version has been passed to it and create the correct socket.
Change-Id: I802c4e2dbe140da40f3f3111aa84d692d4374bb1
This patch is improving the .gitignore files to not track things like:
Python compiled code, Python eggs, VIM swap/backup files, etc...
Change-Id: I2b82d0a54c2584f5a5f7e8792ea8c71aaba48183
To be consistent with the rest of the method this conditional should
raise an exception instead of returning a dictionary with error. Also a
:raises: note was added to the set_power docstring.
Change-Id: I3d99d630019bb180c0ce3cd4cdb7652b32651352
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