2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-15 12:17:44 +00:00

13 Commits

Author SHA1 Message Date
Jarrod Johnson
b985624a4b Remove callback arguments from most functions.
After some contemplation, I realized that given the underlying behavior of 'wait_for_rsp', that
synchronous and asynchronous calls play well with each other.  The pattern of considering an 'onlogon'
function as running in a sort of greenthread works well and leads to much more comprehensible code
for the average person.  While removing those arguments, the module contents were reorganized to
serve as an example of how more straightforward code written in this fashion may be.

Change-Id: I9c83660e4d3c68ad8ae0c016a3377b2a0e7ee6ec
2013-07-25 15:23:06 -04:00
Jarrod Johnson
86a2d39db7 Change session timer to monotonic when possible
Previously the ipmi session was using time.time().  This means
that retries and keepalives could be thrown off by things like ntp
or manual time corrections.

Ideally, we'd use the baked in time.monotonic(), but that doesn't exist
aside from python 3.3

Change-Id: Ia00026cef6df214f9463909309de44767c3752b5
2013-07-23 15:23:20 -04:00
Jarrod Johnson
0e8ca33842 PEP8 compliance
Change instances in code where flake8 complained

Change-Id: I0b125fcff39024f9d4bf3c4c26a863efd0fa5cba
2013-07-16 15:27:04 -04:00
Jarrod Johnson
9dd2c950a7 Add session keepalive
Assure that a live session shows activity at least once every 25-29.9 seconds.
The interval is randomized to mitigate risk of some synchronized activity
bringing on a wave of activity all at once.  The spec indicated timeout is
'about' 60 seconds by default, but an implementation could lower it to 30
seconds within reason within the constraints of the spec.

Change-Id: I74dc78757b11571c23cb309c99eee667787ffc79
2013-07-16 10:53:22 -04:00
Jarrod Johnson
02e353f2fb Add SOL support
SOL support is added in a manner that is actually functional

Change-Id: I3f83e06b27a0d44038ac6e6afcd4f8af1c534946
2013-07-12 16:26:14 -04:00
Jarrod Johnson
a7b4b4a71d Add more constants to ipmi constant list
Allow use of the more helpful names for net function codes in ipmi
specification

Change-Id: I3c7bc71e5df1936fbeac6fcc65e144e1b52ea68a
2013-07-09 14:42:34 -04:00
Jenkins
e9ef542b65 Merge "Correct spelling mistakes" 2013-07-04 16:56:11 +00:00
Jarrod Johnson
e0e39bda9a Fix errors after git repo transition.
I realized that I had never pushed __init__.py for private.

While doing tests locally, I noticed that the pep changes broke at least one
place in code, correct that.

Change-Id: Ia31cb8a75a7109a6d002524e08ef335e1c5018d4
2013-07-02 13:29:26 -04:00
Jarrod Johnson
6360f2ca9e Correct spelling mistakes
Change-Id: I752dc17e8ae3e354253614bdbd5277ca1fd67469
2013-07-02 13:16:16 -04:00
Jarrod Johnson
016326795b Rename _pack_payload to send_payload
Rename '_pack_payload' in private module to 'send_payload' as it is more
descriptive of what is happening and will be called by console.py

Change-Id: Ifa70d269c8a1e37cc5b6466845931f22cd97d6c3
2013-07-02 12:43:59 -04:00
Devananda van der Veen
ca22a48de5 Fix all pep8 errors except E128 and E501
Ran autopep8 on the four .py files in this module.
Manully fixed many additional pep8 errors as well,
Turned some long-line-comments into proper NOTE lines,
but there are more to do...

Change-Id: I657ba037863860ec3956150931c2c0e41085bd63
2013-07-02 06:11:39 -07:00
Jarrod Johnson
0a01fe446d Reorganize pieces into 'private' to suggest to consumers the bits tehy need not think too hard about 2013-06-28 10:31:43 -04:00
Jarrod Johnson
bc19838268 Reorganie things and add a setup.py for fun 2013-06-27 15:56:19 -04:00