2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 19:57:47 +00:00

345 Commits

Author SHA1 Message Date
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
Jarrod Johnson
03e3da529b Add TLS support and TSM remote video (WIP)
Provide a method for applications to evaluate target
certificates.  Force them to do so if such a thing is
needed.  Use this to support TSM remote graphics, which
sholud be over https for sake of security.

Change-Id: Ie67b629b0021c356d2ea001e24c72ad196e5460d
2015-11-20 13:48:10 -05:00
Jenkins
4cc75b4736 Merge "Avoid abandoning retry when SOL packet is not ACK" 0.9.8 2015-11-10 19:51:22 +00:00
Jarrod Johnson
fbd95bc3b3 Avoid abandoning retry when SOL packet is not ACK
The design was to abandon retry when data comes in,
ACK or not.  This became a problem when console.py
retried under frantic conditions, confusing some
BMC implementations, and so that was removed.
With that removed, BMC traffic was still cancelling
the retry, but nothing was reinstated in retry anymore.
Fix by having session.py understand a few bits of SOL
payload enough to identify at least if it is *an* ACK
at all.  If it's one of the 'weird' ACK scenarios,
sol handler still must handle, but simple no-ACK scenario
now contained in session.py.

Change-Id: I609ff783cd6cc2bf431271280bb55da4126f2cfc
2015-11-10 14:42:13 -05:00
Allan Vidal
37c4eb42c6 Change DIMM SN parsing in TS to match WebUI
Change-Id: Ia506ca9945db98e1facaddc973cf43f2b9dd0f36
2015-11-09 17:09:12 -02:00
Steve Baker
035dfb2fa4 Allow bind address to be specified
This change allows IpmiServer objects to be created with bind addresses
other than ::. It is useful when multiple BMC processes are running on a
single server, with each bound to a different nic.

Change-Id: Ice82bf788269a31819e4495e15b9ce19a1dd057b
0.9.7
2015-11-05 15:53:06 +13:00
Steve Baker
df19985878 Only bind on tmpsocket once
Since change I8f566543c8da28eb7ed76f1cb80ff4cb2dcbba96 openstackbmc has
failed to start with the error:

  socket.error: [Errno 22] Invalid argument

Moving the early bind so that it is only done when there is no server
specified has fixed the regression for openstackbmc.

Change-Id: Icb16cdc386fb08b54f28b7dff235eb697f1450ee
2015-11-05 15:52:55 +13:00
Jarrod Johnson
1b5ae5d8e0 Fix exception on logout
When logging out, the session is obviously not logged
after the request to logout has been processed.  If
retry is False, do not be surprised we don't have a 'lastresponse'.

Change-Id: Ia5cbdab3736148fa36ced8835bd8d9fdca1dc12d
0.9.6
2015-10-30 15:56:30 -04:00
Jenkins
50d6b2bce1 Merge "Fix TSM detection" 0.9.5 2015-10-30 18:05:11 +00:00
Jarrod Johnson
c5902bb0c8 Fix TSM detection
As of recent System X hardware releases, the mfg/device id
values are now ambiguous.  Go deeper in the tsm detection
to assure the system is indeed a TSM system rather than IMM
or other.

Change-Id: Id63d015bf03e9ea9501503543effd31e01691b31
2015-10-30 11:28:05 -04:00
Allan Vidal
ac5bdc9c71 Add device ID fields to FRU 0
Change-Id: I4287d7a7732ffff00e708c05485d5b0afb37fd2d
0.9.4
2015-10-30 11:37:29 -02:00
Jarrod Johnson
f6386e42fa Fix raw_command hang when externally 'broken' or 'logged out'
When something requests logout in the middle of a command request,
bail out with 'session no longer connected' rather than infinite loop
waiting for lastresponse which should never come.

Change-Id: I9a8592a72b687f90bc044bbe48fd87d79b35d780
0.9.3
2015-10-28 10:36:49 -04:00
Jarrod Johnson
9b6e6b9ba0 Do not raise on bad/unsupported FRU data
If a FRU device presents data that pyghmi does not understand,
treat it the same way as if it were not present, do not decode.
Some systems simply do not have usable FRU data despite having a
pointer to a FRU device.

Change-Id: I440cee3366b5da4555b67b41492fa017dbe3dcef
0.9.2
2015-10-26 10:08:21 -04:00
Jenkins
d25caa1aad Merge "Implement custom timeout and apply to TSM NTP" 2015-10-26 13:42:37 +00:00
Jenkins
7b444a496f Merge "Handle missing UUID" 2015-10-26 13:38:41 +00:00
Jarrod Johnson
f41fee099b Implement custom timeout and apply to TSM NTP
TSM NTP enable retry could trigger the TSM to lose its
mind.  Workaround by having a large, custom timeout for
NTP, to either get positive acknowledgement or timeout,
even though no retransmit would occur.

Change-Id: I3f83e5a1f1e1957bad119951c7e73ade5154b351
2015-10-26 09:30:51 -04:00
Jarrod Johnson
68c7979349 Handle missing UUID
Some TSM FRU elements do not have a FRU entry.  They may
be marked by all spaces, all 0xff, or all 0x00.  Skip UUID
if it is one of these obviously invalid values.

Change-Id: I90c8bbe3c66754bcb6d6200b63a2ff2c29ae63ec
2015-10-23 16:17:12 -04:00
Jenkins
f9702d902f Merge "Workaround likely spec deviations and fix parsing" 2015-10-23 20:11:59 +00:00
Jarrod Johnson
3411537228 Workaround likely spec deviations and fix parsing
For one, was doing UTF-8, though the encoding strictly speaking
per speac should be ISO-8859-1.  Corrected that mistake.  Also
workaround an issue when FRU may be programmed with 0x0 or 0xff
bytes to terminate, or spaces.  The spec actually doesn't speak
to a strategy to pad strings (presumably because they assumed
implementation would avail itself of the capacity for variable
strings and not need to deal with silly fixed length fields).
Handle this by trimming out trailing spaces, 0x0, or 0xff.  This
strictly speaking violates the spec if they want to use one or more
ÿ to end a field, but will take the risk that no one actually would
want to do that.

Change-Id: I7d7e3aa9f3fd2b1e1af75f98cabd49ca374755c0
2015-10-23 15:47:24 -04:00
Allan Vidal
c692005b5a Fix crash on missing "board_extra" field in FRU response
Change-Id: I9fc95282926ef9a7f3847f38116736dabea5c3bb
2015-10-23 10:25:35 -02:00
Jenkins
e96bd8f67c Merge "Stop spurious retry on incoming data" 0.9.1 2015-10-21 19:14:03 +00:00
Jarrod Johnson
cf351d1806 Stop spurious retry on incoming data
When data came in from a BMC before acking a recent
transmit, pyghmi would pessimistically take that as
a cue that the data was missed in transit.  However,
if the data happens to be on the wire before an ack
that is coming, this is a senseless retry.  This
retry happens typically within a few milliseconds of
the original.  Fix this by ignoring the non-ACK related
data as a cue for doing a retransmit.

Change-Id: I871377da0265a5e258baf922252ae86df6c578b0
2015-10-21 15:07:38 -04:00
Jarrod Johnson
2a7d6f3662 Fix chunk length when unicode on MCI
Unicode data probably won't work, but to the extent it could
work, it would be incorrect to do length on the unicode rather
than length of the utf-8 encoded data.

Change-Id: Id39484abff603fdaab421f3395063b17edd3ae15
0.9.0
2015-10-20 13:25:27 -04:00
Jarrod Johnson
9103d554e0 Handle unicode DCMI data incoming
If unicode string data is submitted, pass
it along as utf-8 encoded bytes.

Change-Id: I00adc7aff4dcf06061a9fad69ed33cd784e7fe1b
2015-10-19 16:35:17 -04:00
Jenkins
45b4afa1da Merge "Update .gitreview for new namespace" 2015-10-19 20:22:19 +00:00
Jeremy Stanley
5d924099a4 Update .gitreview for new namespace
Change-Id: I7866226f74c5efdff8912afa4d351e9d2101edac
2015-10-17 22:36:04 +00:00
Juliana Motira
c85a0f3c77 Fixing fru date
Change-Id: I1f9a5e5f7bd317e5f54cdbbaaf093938b164a8b4
2015-10-16 14:42:01 -03:00
Jenkins
0378a45ae4 Merge "Fix TS inventory parsing bugs (DIMM, PSU)" 2015-10-15 13:43:37 +00:00
Allan Vidal
d560e17389 Fix TS inventory parsing bugs (DIMM, PSU)
Change-Id: I4c1eb83db7950aba542a5931e172232b1395239f
2015-10-15 09:17:53 -03:00
Allan Vidal
e3a077a853 Change acknowledgement_timeout to acknowledge_timeout
Change return value key for get operation to match the name used in
the set operation.

Change-Id: Ie53910e3049618475478df2ebc93edf465d6b0e3
2015-10-14 17:12:27 -03:00
Jenkins
c2238a8587 Merge "Fix attempt to get LED against System X" 2015-09-28 17:11:37 +00:00