2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-13 11:17:47 +00:00

375 Commits

Author SHA1 Message Date
Andreas Jaeger
a1725c1a07 Remove unused pngmath Sphinx extension
There's no RST file that uses ".. math" and thus
the pngmath Sphinx extension is not used and can
get removed.

Change-Id: I3ea4b529025c8ac3c4092f3720124647861e6668
2016-05-10 13:56:06 +00:00
Jenkins
d517799899 Merge "Allows BMCs to configure the event loop timeout" 1.0.3 2016-05-09 13:27:10 +00:00
Lucas Alvares Gomes
f06813cd22 Allows BMCs to configure the event loop timeout
This patch is adding a new parameter called "timeout" to the listen()
method of the Bmc class to allow configuring the right timeout for the
IPMI session. The default timeout continues to be 30 seconds, just like
it was when hardcoded.

Change-Id: Ie00d62157eea321747e02492b0a3d1d6ff991024
2016-05-09 11:36:53 +01:00
Jarrod Johnson
c634450230 Add Hardware inventory from Lenovo Agentless
Lenovo System X systems offer up more inventory over agentless.
Provide this data when the possibility presents itself.

Change-Id: Ic377e951b5a6308157891f98dfdad6311337af48
2016-05-06 16:46:48 -04:00
Jarrod Johnson
6f807ebc42 Fix IPMI server functionality
When data steering was implemented to improve
performance, the server component was not updated
to be able to receive steered data.  Update the server
component with the needed interfaces to be compatible
with the performance enhancement.

Change-Id: I251cfaaf80d7ae45b60f03e39a46a683d913396b
1.0.2
2016-05-04 10:40:05 -04:00
Jarrod Johnson
0a51831bf0 Add disk inventory when possible from Lenovo IMM
Agentless data may have information about firmware of
disks.  This commit adds support for reading it when
available.  Note that some devices may not appear,
depending on the drive controller in use and timing
factors.

Change-Id: I24033a4fe7ed056018dab2747e71845fdcaa5cf0
2016-05-02 16:15:55 -04:00
Jarrod Johnson
3fe1b5f60f Cope with empty agentless fields
Some adapters present empty agentless fields.  For
such scenarios, skip enumerating the key.  This avoids
date parsing errors, among other things.

Change-Id: I3df5f1dd320aa2e915760b6d2cae0f04ec5e09c6
1.0.1
2016-05-02 10:16:08 -04:00
Jarrod Johnson
7b59b7759b Briefly cache adapter data
It is frequent that a client may hammer request
for firmware inventory.  To facilitate this use case,
store and reuse data for 30 seconds, so long as the ipmi
session has not changed.

Change-Id: Ia356e3161a2ccf1c717eec09696e265263d8255b
2016-04-29 16:25:14 -04:00
Jarrod Johnson
deded4f295 Add 'Trusted IMM' to IMM inventory
IMM has an active, backup, and trusted image.  Add
info about the trusted image to IMM inventory to
make that clear.

Change-Id: I771cee6831d11c2b7dbc780475582e9030d7e7b6
2016-04-29 11:16:32 -04:00
Jarrod Johnson
120d5f9a82 Passthrough errors when not sent by BMC in MegaRAC
In the 'has_megarac' call, it erroneously was assumed that
any IpmiException reflected the BMC indicating explicitly that
it didn't understand something about the command.  However
IpmiException is frequently used without a code to indicate
some harder error that can't relate to a system return code.
Address this by raising the exception if it didn't have a
BMC error code initialized.  It may be possible to get even
more specific, but somewhat limited because we could be getting
a 'invalid command' or 'invalid command length' or some 0x80
neighborhood error code, some OEM response.  Fortunately
things are limited since this code should only ever fire
against Lenovo equipment, but still keeping things open ended.

Change-Id: Ia84d1474f7d6787d162c6c7ef448f269d826cc2a
1.0.0
2016-04-25 09:28:41 -04:00
Jenkins
d0f51df896 Merge "Change strategy to identify IMM" 2016-04-24 12:19:34 +00:00
Jarrod Johnson
700dd0c752 Change strategy to identify IMM
Other Lenovo equipment uses the 'get build id' command.  This
switches to a facility more specifically designed to indicate
what class of Lenovo service processor is in play.  As a result,
the firmware inventory function has to fend for itself.

Change-Id: Id0354ebd4dbf57a0ff59860df663195b93adba1c
2016-04-24 08:08:36 -04:00
Jarrod Johnson
52e3eb6874 Do not hook generic vendor identifier
A prerelease system was using 7154 vendor id internally,
but this is not going to be the case when released.  Stop
hooking generic value to avoid being overly aggressive.

Change-Id: I19258e226c03b0158c9a4a3430eaa1de33c10648
2016-04-24 07:39:20 -04:00
Jarrod Johnson
6360d54351 Add support for IPv4-only environments
IPv4-only environments may come in two forms.  It
may not even have kernel support for AF_INET6, detect
and tolerate this by fallback to AF_INET.  Secondly,
it may have AF_INET6 support, but not have any IPv6
addresses, including ::1, so fall back to IPv4 localhost
in that scenario.

Change-Id: I9e2f992afa9f6e71d1210701ac53080d8e788028
2016-04-23 10:29:11 -04:00
Jarrod Johnson
8a7a909b2e Add system X firmware information
This commit adds support for fetching extended System X firmware
information.  This includes, as supported by the model,
extended IMM info, backup IMM, UEFI (primary, backup, and pending),
as well as available firmware from agentless system x options.

Change-Id: Iea09af0dd54938dbfe54b64c0a1084cb7ad2264f
2016-04-23 10:12:23 -04:00
Jarrod Johnson
40eb4c014d Be apathetic about endianness of SOL port number
Some implementations are confused on the endianness of SOL port number.
Recognize both 623 and 28418 as the default.  This poses a challenge
should the day come that non-standard port is desired, but it seems
very unlikely for that to come up...

Change-Id: Ib184a9102fd24a0c27d7a3f5adf86b8d1dca22ea
2016-04-13 11:59:05 -04:00
Jarrod Johnson
a01e705ab7 Fix get_health with a NextScale FPC
There was an oversimplified assumption in play.  Provide
a method to enumerate the generated names as well as
the static names.

Change-Id: I08dbaaafd7c607869d185f57bae0ea70ebf1084e
2016-04-12 14:12:06 -04:00
Jarrod Johnson
14fa128a18 Implement MegaRAC IPv6 SNMP destinations
MegaRAC does not support IPv6 standard destinations,
implement an OEM fallback for no standard IPv6, and
provide the MegaRAC backend for it.

Change-Id: I4732f47182df71607db57292a2b7de58623f0f45
2016-04-08 16:21:39 -04:00
Jarrod Johnson
9712efcf52 Do not warn on nearly full SEL
SEL being almost full isn't that large a concern,
demote this to 'OK'.

Change-Id: I94167badd2320d316d5f58a96f767a23946b5df5
2016-04-07 11:01:01 -04:00
Jarrod Johnson
fe9d6b06fa Fix use of weakref.ref
Do not try to doubly use weakref in SDR,
and otherwise use a more transparent weakref.proxy,
since we are not hashing any values.

Change-Id: Ib1e0e59b2e52988d75830ffa5422407c53a68561
2016-04-04 09:39:03 -04:00
Jarrod Johnson
9b547cfb5a Fix cyclic references in SDR
SDR and SDR entries had a cyclic reference to ipmicmd.  Weaken
it so that it won't cause issues (whether real or just
complicating output of guppy)

Change-Id: Iad9c9726026f46c9a104c4a7464fad9b17d336ea
2016-04-04 08:12:17 -04:00
Jenkins
b9f50792d7 Merge "Discard reference when no longer needed" 2016-04-04 12:04:07 +00:00
Jarrod Johnson
f5f80c9cb6 Discard reference when no longer needed
If an 'onlogon' handler is passed, discard it after being invoked.  This allows
the objects to be garbage collected where otherwise they may not be.

Change-Id: I92488adca9150204512db5e4872e2b54bd0c076d
2016-04-01 17:10:23 -04:00
Jenkins
1a7618c311 Merge "Remove a cyclical reference in Lenovo OEM" 2016-03-31 21:06:47 +00:00
Jarrod Johnson
195f370418 Remove a cyclical reference in Lenovo OEM
For now, use weakref to break a cyclic reference.

Longer term, probably refactor the needed 'xraw_command' to session and
pass session to the handler rather than the parent command handler.

Change-Id: If129ff6abf8666978aa05b6695ed7373070cd6b9
2016-03-31 16:57:21 -04:00
Jarrod Johnson
7ee86b3e85 Remove event related memory leak
It was possible for a session to accumulate
a plurality of events per raw_command issued.
Alter the behavior of session to set and discard
*all* pending events on exit.  This means that if
there are multiple commands waiting, then things
will be a tad more work than is strictly necessary,
but it's the simplest way to eliminate the leak,
the amount of senseless work is pretty small even
in some pretty tortuous cases, and it only has
any impact when many commands are being hit against
same target concurrently without coordination, which
is rare.

Change-Id: I3f023cee6fc7bb537c1a508d3113f2ff238828de
2016-03-29 15:26:42 -04:00
Jenkins
4de77dce9c Merge "Change DIMM serial to show 0 padded hexadecimal" 2016-03-27 14:29:52 +00:00
michaeldu
8dcca54f98 Change DIMM serial to show 0 padded hexadecimal
Other tools use DIMM serial numbers in hexadecimal.  This
makes sense as the underlying format is unspecified, so
a hexadecimal value would make that more clear.

Change-Id: I724d76ea8af7d20ee8ff0e294a9f96ffb571e80e
2016-03-27 10:11:36 -04:00
wangbo28
14b3bb5d0c Fix UUID padding problem
Correct the format width since it is the width of the characters vs
bytes.

Change-Id: Ie01036584ebeba674475e07d2786ea02f6db2f98
2016-03-27 10:07:55 -04:00
Jarrod Johnson
09367b3f0a Determine speed from clock by formula
Rather than use a lookup table (which requires maintenance),
implement the formula used to calculate the speed.  This further
makes it a bit more robust in the face of minor timing tweaks
that might change the clock a megahertz up or down.

Change-Id: I6336bdc07af361a31b5a51698d0231d876791f16
2016-03-27 09:08:09 -04:00
Jarrod Johnson
8d41ce6331 Avoid stall waiting on incommand
It was possible for multiple command requests to be pending.  While pending,
if a waiter was awoken first, *then* the satisfied command, then the waiter
will stall in the next iteration, recovering only after the failsafe mechanism kicks
in.  Address by having the instance clearing incommand set() the next event in
line.

Change-Id: I8dbd08027596b4acccace6599f996ad547a47768
2016-03-26 13:32:26 -04:00
Jarrod Johnson
3d2da22dd2 Implement detach media
Allow detaching remote media, the converse of the attach_media call

Change-Id: I45c71e02bb817b5c26b4de87b52de90c273ce526
2016-03-25 13:50:42 -04:00
Jarrod Johnson
15ddafb8fb Allow skipping retrieval of gateway mac addresses
As a network configuration item, gateway mac addresses are rarely used.  However,
some devices consider such a request an attempt to do arp, and will slow their response
trying to fill in a field that no one cares about.  Allow calling code to disable fetching of
this frequently problematic data.

Change-Id: Ia9b434e2a74983d822c91d5248815a0312942c15
2016-03-25 13:20:25 -04:00
Jarrod Johnson
7d782e7cd5 Provide attach remote media function
Provide a function for indicating a remote media by URI.
Implements the underpinniings with respect to MegaRAC
underpinnings.

Change-Id: Icbaa8f91fad26632834335cc29eff57d14ee6450
2016-03-25 12:31:34 -04:00
Jarrod Johnson
ddbbe53f78 Have ipv6 addresses always be represented as list
IPv6 interfaces tend to emphasize more open ended
use of aliases.  To support this, have ipv6_addresses
manifest as a list, to allow for implementations to
extend to represent more complex situations.

Change-Id: Ia5727ff4830da58f847a7090e45dc819d4f216b2
2016-03-21 17:01:47 -04:00
Jarrod Johnson
69266bc95f Add support for OEM command for IPv6 address fetch
Prior to IPv6 being pulled into the proper specification,
there were OEM commands to implement it.  Pull in the AMI
OEM version for systems with TSMs present.

Change-Id: I137887fc57a3daa652f1e0a1bd50a806d3e42b13
2016-03-21 16:20:58 -04:00
Jenkins
78d95b8afb Merge "Add a new README" 2016-03-21 19:13:16 +00:00
Allan Vidal
a7bebf283b Add a new README
Change-Id: I4837cde33d17171a97a142917ef2c1f2690b6238
2016-03-21 15:04:26 -04:00
Allan Vidal
fae22cae07 Change graphical console launcher to use base64 encoding
Change-Id: Id8b0ae08189914dd75824c1e4644efa95fe7d60a
2016-03-21 14:52:33 -04:00
Allan Vidal
2f31a94c9e Add support for TS graphical console fetching
Change-Id: I89ecff86d8b6f264764128d7ec327985a76545b0
2016-03-21 14:34:39 -04:00
Jarrod Johnson
65219f2353 Rework wait behavior
Rework the thread behavior and raw_command to avoid
a ton of needless wakeups for unrelated concurrent execution.
It is saving about 20% of CPU time on ~50 node run.
The savings should scale proportionate to concurrency.

Change-Id: Iff3eaacd6c92d5734e1d1eb19e7be53e269e42cc
2016-03-13 15:29:47 -04:00
Jenkins
c2652f11bb Merge "Fix synchronous logon premature exit" 2016-03-13 14:13:58 +00:00
Jarrod Johnson
b43988cac5 Fix synchronous logon premature exit
When logging in, the caller is released to submit a new command before
the session is actually logged in.  Fix this by waiting for the appropriate
flag to go False.

Change-Id: I884b7da1b64c6786f673a18ee4c7d2ca69ec0bff
2016-03-13 09:52:14 -04:00
Jarrod Johnson
bb9436aa2e Fix 'uptime' time correction attempt
When doing the attempt to correct time, the sense of comparison was
incorrect and the timestamp field was neglected.  Correct this
mistake and oversight.

Change-Id: Ia3ff187d0eaedcfea9f3b7d2c8f292162bb3bb50
0.9.9
2016-03-01 15:25:48 -05:00
Jenkins
02d13366ee Merge "Deprecated tox -downloadcache option removed" 2016-02-11 21:44:24 +00:00
Jarrod Johnson
709e35c103 Add OEM sensors for Lenovo Nextscale
Nextscale Fan/Power Controllers have several data
sources that would normally be considered 'sensors',
but are implemented through proprietary commands.
Extend the sensors data from these sources.

Change-Id: Ieaaae54b3edb409fac8f3932d51175c61ebdc44f
2016-01-11 15:10:22 -05:00
Ondřej Nový
59150c8c30 Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I0eec04a73e98048ea705bba01fd8d84b605b874e
2015-12-11 23:20:31 +01:00
Jarrod Johnson
f8d77ac2cc Add license parameter to setup.py
In order to have bdist_rpm output serviceable,
add the license field.  This results in an rpm
that has all the fields desired.

Change-Id: I18f75f89385ac5022050372925c19f46206244f9
2015-12-01 14:30:01 -05:00
Jarrod Johnson
25165b68a6 Point to more specific page for pyghmi
Rather than pointing to generic xcat, point to the
github page for pyghmi

Change-Id: Ic07ad5db1e39d3a37a3ce24ff77c76bffbb4ee72
2015-12-01 13:18:53 -05:00
Jarrod Johnson
5341960c0b Update my email
My email is no longer us.ibm.com.  Point to my Lenovo address instead.

Change-Id: I08143249032ca46ea96b36aad03c57cad443040c
2015-12-01 09:44:35 -05:00