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

761 Commits

Author SHA1 Message Date
Andreas Jaeger
cdbdfa63d7 Update docs job
Replace obsolete sphinx-build job with tox-docs job, use
a template for this.

The newer job uses "tox -e docs" directly.

Add sphinx requirements for python 3.

Change-Id: I1acc55a470ebacce812ba6840663302d759f69b7
2019-05-20 09:12:31 +02:00
Jarrod Johnson
012d8f18b7 Fallback to MessageId
If an implementation provides no message, at least use the MessageID.

Longer term this would be consulting the redfish registry to get the
correct message with messageargs interpolated, but for the short term,
at least provide this.

Change-Id: I099745e929dbfa5b11d630966308f6986eef41e5
2019-05-16 10:02:37 -04:00
Jarrod Johnson
775efe6f57 Fallback BootSourceOverrideMode for older systems
Older redfish implementations did not support this request attribute.  Try
with the attribute and if it fails, just don't try injecting the attribute.

Change-Id: I80b2e725822f0de9a6dd12df17b5c7347b094431
2019-05-16 09:42:53 -04:00
Jarrod Johnson
33db8cdfeb Add mandated client headers
Since we added gzip support due to a non-compliant
implementation firing gzip at us anyway, advertise
so that we have the benefit for compliant implementations.

Also add the OData-Version header.  This is required but
mostly not needed, except one implementation that uses it
to enter standard compliant mode and is non-compliant
without that in the client.

Change-Id: Ie2fdb95fa12f2ddef46506ca531e5188b6019227
2019-05-16 09:21:19 -04:00
Jarrod Johnson
5a15c6b604 Fix system_configuration
Some redfish implementations may use a trailing slash in registries.

Additionally, any json may be gzipped.

Support these two scenarios.

Change-Id: I6437af21c927d13a74e8d914ed261412c1a3afa1
2019-05-14 16:51:52 -04:00
Jarrod Johnson
904a2428c7 Add fallbacks for more redfish implementations
Redfish implementations can get dodgy about some things
and use different names for the same thing and different
mappings depending on vendor opinion...

Change-Id: I7ec5f1754fcfeca3933dd22a91d1a2daa037e501
2019-05-14 15:30:10 -04:00
Jarrod Johnson
61e5a9967b Add get_inventory_of_component
redfish did not have a compatible function for the ipmi get_inventory_of_component.
For now, only provide fastpath for system,
other components are difficult to have shortcuts for.

Change-Id: I1998186340b206a997fd0c062bec02fcb0af5ebe
2019-05-13 15:18:17 -04:00
Jarrod Johnson
ee63d83dac Allow caller to opt out of some behaviors
For keepalive, there are applications that can self heal and
would rather close an idle session instead of keeping it alive.

If the caller knows exactly that it wants to be administrator,
then do not automatically allow the session to downgrade to
operator.

Change-Id: Iefaf04387e28da9d7f2c613d567cd83ce69c2c03
2019-05-13 09:03:54 -04:00
Jarrod Johnson
0f115fdb02 More clearly indicate bad credentials
When used with invalid credentials, present a more clear
exception rather than a missed member of a dictionary.

Change-Id: I1e5bda9368673db62dce3ca2fd321cd79c62cb9c
2019-05-07 16:20:48 -04:00
Jarrod Johnson
70bf3cf165 Cleanly degrade on bad BMC time format
If a BMC provided a time, but the format was not compliant,
it caused an exception.  Now gracefully degrade to not
doing time correction if time cannot be parsed.

Change-Id: I5ab45d51913232016bb55d3595ea30188bbfe2e7
2019-05-07 10:08:48 -04:00
Jarrod Johnson
b8254fb5b9 Use dependency information for error checking
This uses the Dependencies section to perform validation
of data provided by the caller.  This produces more informative
error messages without having to reboot to examine why.

Change-Id: I6360b8a2694e42d7b848de9ce45466c88e722c91
2019-05-07 08:44:25 -04:00
Jarrod Johnson
a55dacf1d8 Provide better messages when redfish provides
This provides a more informative behavior in the clients.

Change-Id: I7cecc39c3928aac6ee2d9b86ed53159dcdf3dde5
2019-05-01 11:45:16 -04:00
Jarrod Johnson
5c2c5d797f Get pending settings with current
To be consistent with the ipmi settings, present the pending
as the 'value' and 'active' for the current value for pending
settings.

Change-Id: Ia99374732f05509d2796b5e2166c686716e93c69
2019-05-01 11:06:02 -04:00
Jarrod Johnson
1988c09d48 Use the registry info to help set
Provide support for wildcards in settings and attributes,
as well as case insensitivity.  This brings set nearly to
parity with the XCC configuration set in the ipmi half.

Change-Id: I6eef01af8e9e3bb7be03538509a606728c3c33da
2019-05-01 10:41:17 -04:00
Jarrod Johnson
e073e078a8 Have get_system_configuration get detail
Use the bios attribute registry to flesh out detail
when available.

Change-Id: I43cdc8ad6cefef83f45787000259f4962f9e1b37
2019-05-01 09:49:01 -04:00
Jarrod Johnson
42c21cfb3e Add sensor data to redfish
Redfish models a moderate amount of data that can map to sensors.
Provide a preliminary partially compatible sensor model.

Change-Id: I10cadac5871497ef89f14b95924a5f4c3be52b01
2019-04-23 16:20:38 -04:00
Jarrod Johnson
13c7d6d3b5 Convert to localtime
The IPMI module returned localtime, be consistent with that behavior.

Change-Id: I7a787ffb4b9aac81e54cc20707e97087a97d5d16
2019-04-22 15:54:26 -04:00
Jarrod Johnson
5979a2b215 Add log clear to redfish log
This permits log clear while ensuring
that the log data did not change between retrieval and deletion.

Change-Id: I15ef6bb330612b83a6acb1dcf3663eb60bb8363b
2019-04-22 15:28:21 -04:00
Jarrod Johnson
f2f1ddb4a3 Ignore blank numeric default
Some settings that are numeric show a default of ''.  Such a default is not usable.
Treat such a situation as a default not existing.

Change-Id: Id3931da7128a732f62863055a93117a3abd05805
2019-04-22 14:10:42 -04:00
Zuul
91140fdfca Merge "Add redfish log support" 2019-04-22 13:20:48 +00:00
OpenDev Sysadmins
03c9aa0510 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:49:52 +00:00
Jarrod Johnson
f064774ddd Add redfish log support
Change-Id: I7b0ad31da8a178acaffb3c61d189f12d5d0143ac
2019-04-18 17:00:49 -04:00
Jarrod Johnson
f710b1d30a Add OEM extensibility framework to pyghmi redfish
This enables OEM specific override for enhancements beyond the specification
when avaible.

Change-Id: I6a10f1fa58a425b2abfbeb9c85dd72c3b7d4cbba
2019-04-18 13:58:24 -04:00
Jarrod Johnson
a05c044874 Add clear system configuration to redfish
Implement clear uefi configuration for redfish targets

Change-Id: Id85c13b773597ae331902ae91ad3d8bcc0b9982b
1.3.0
2019-04-15 14:22:11 -04:00
Jarrod Johnson
60313e76c0 Workaround 7Y36 model bug
7Y36 firmware does not populate u-height.
Workaround the bug by embedding the correct value for the model.

Change-Id: I78481b7ec80956d76e6085855d35cd7c6886a225
2019-04-12 13:50:23 -04:00
Jarrod Johnson
9e51f88a20 If no u-height, revert to default behavior
Change-Id: I94dd5c8dd5b535c39b4b3df579961620e470c31b
2019-04-11 17:15:14 -04:00
Jarrod Johnson
7004a1a4c5 Address another location where 108 may appear
108 indicates the XCC had a temporary problem trying
to juggle the update internally.

Change-Id: I8c444c04c05b5cfee475b0601e88144c6980cdf6
2019-04-11 12:39:33 -04:00
Jarrod Johnson
03aabc6fd3 Protect more unspported instance variables
A new category of settings have instances without declaring
maximum instances.  Autosense and hide these sorts of settings.

Change-Id: I5334d6fad76454674dc0c1ffa094c2178e950c66
2019-04-11 10:38:21 -04:00
Zuul
ce62bdda95 Merge "Implement redfish set_net_configuration" 2019-04-11 13:04:12 +00:00
Jarrod Johnson
a71076c0be Implement redfish set_net_configuration
This allows using redfish to set network parameters.

Change-Id: Icab70a377194ccc2a5e2058692e6b4a37a9057b3
2019-04-10 17:12:00 -04:00
Jarrod Johnson
70de56bcbc Remove a round trip delay for inventory
Enable potential concurrency for CPU and Memory
parent urls.

Change-Id: I258f5418efb32db3c171849749cd6f390b0724aa
2019-04-10 15:39:48 -04:00
Jarrod Johnson
9c4e520d93 Attempt bulk request of inventory
Bring more urls together in hopes of performance
through concurrency.  There are still points of
serialization, however.

Change-Id: Ie2b4eebe84cbd35e08a6fbf703d3a2b15a17026d
2019-04-10 13:21:27 -04:00
Jarrod Johnson
3475b97a91 Workaround 'dead' IPv4 addresses
Some redfish implementations leave a dead DHCP definition when
configured static.  Filter out such an address when encountered.

Change-Id: I25ff6b07ff75b67f7661157a8a0f1dc230f9010c
2019-04-09 15:36:58 -04:00
Zuul
cd14632ba6 Merge "Support SYSTEM_PROD_DATA" 2019-04-04 21:28:47 +00:00
Jarrod Johnson
d203f82c20 Support SYSTEM_PROD_DATA
The config section is the only ungrouped
section.  Give it special treatment.

Change-Id: I1b23ad1c47b43741a890711810d932da6ef45e5f
2019-04-04 16:51:14 -04:00
Jarrod Johnson
a444c31b06 Hide instanced and password settings
These are currently not supported.

Change-Id: Ie38e38ebe199d61aedbd624c1dedca6f33ae5d02
2019-04-04 16:23:16 -04:00
Jarrod Johnson
02b78e2251 Skip empty firmware values
Some select configurations may induce
a null firmware entry.  Disregard such entries.

Change-Id: I5eea54b8d836aa2fb0c0b6f8d87b45c39bb28534
2019-04-04 13:17:17 -04:00
Jarrod Johnson
eb7869bfa7 Handle 413 directly on the upload
413 may return on the upload, but sometimes not the status
query.  Support the direct evaluation of the return code.

Change-Id: I4e8e8f4a03adc00d4c1de3a1fe4fbcb5d1b3d8f3
2019-04-02 13:03:51 -04:00
Jarrod Johnson
06159c4e1c Fix fallbackdata
Fallbackdata was actually being preferred rather than a
last resort.  Fix by changing to a more usual return
scheme.

Change-Id: I098dfc424c173c87c24a712efdebefb46f724473
2019-04-02 11:26:01 -04:00
Jarrod Johnson
191acd0758 Have LED fallback force a sensor if no other explanation
This mitigates the poor appearance of the 'unexplained health'
scenario.

Change-Id: I5b41c51050789773a3851b39137316deee05f74b
2019-03-28 10:22:14 -04:00
Jarrod Johnson
13025ea364 Add token refreshes to adapter update
It was observed that an adapter update could be inflicted
with an expiring token.  Aggressively refresh to mitigate
this.

Change-Id: I7624e8c9abbfdc4e8fd3b323f868d3606cd0039e
2019-03-28 09:43:27 -04:00
Jarrod Johnson
85352d68bc Refresh token throughout upload_media
Certain calls were exceeding the lifetime of the token, add some
refreshes to keep token up to date.

Change-Id: I539f6323715ddacc5b435a61b2a1d9af65f29c2b
2019-03-28 08:46:08 -04:00
Jarrod Johnson
e47fc0d6a8 Fallback behavior on unparseable conditionals
If firmware offers up an unparseable expression, prcoeed as if the
expression were not there in the first place.  The occurance observed
was not viable.  This hampers the improved error message, but the
firmware will still enforce any rules.

Change-Id: I2be9db12b9fa8da9d40bf6829b3cdc02bbdc946d
2019-03-26 14:58:23 -04:00
Jarrod Johnson
7e2a0e258c Genericize bulk requests and fallback to Id
Independent concurrent requests are going to be a way of life, add
a generic helper.  Future modify to take a dict of urls to handlers
to launch handlers in a pool as well.

Names are usually more descriptive, but are occasionally not unique.
Fallback to Id for devices that conflict.

Store name map to urls for faster performance of
get_inventory_of_component

Change-Id: I83207d24c8bd2a23ac0d16ab5e1777f7df8d4369
2019-03-25 15:35:14 -04:00
Zuul
a21ede6bc3 Merge "Replace openstack.org git:// URLs with https://" 2019-03-25 13:14:03 +00:00
Ian Wienand
3f3c48037f Replace openstack.org git:// URLs with https://
This is a mechanically generated change to replace openstack.org
git:// URLs with https:// equivalents.

This is in aid of a planned future move of the git hosting
infrastructure to a self-hosted instance of gitea (https://gitea.io),
which does not support the git wire protocol at this stage.

This update should result in no functional change.

For more information see the thread at

 http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003825.html

Change-Id: Ib91d991abd3e2166797130573808810492a88089
2019-03-24 20:35:47 +00:00
Jarrod Johnson
a1af60ac9b Performance enhancements for redfish
This permits the code to be able to risk redundant fetches without high
performance penalty through caching.

It also introduces a way for calling code to provide a concurrency
pool, e.g. a GreenPool from eventlet.

Change-Id: I60c4aabb5064a5ee19b0804a520d4ace1195710e
2019-03-22 15:52:11 -04:00
Jarrod Johnson
b45253eacd Add missing headers
Some implementations balk at lack of 'Accept' header.

Change-Id: I99d840e7357a7c0d04bcbd1bb7695c8512be0281
2019-03-22 14:42:57 -04:00
Jarrod Johnson
0bdf26f8c9 Fix mistake in IMM set property
There was a mistake in the code to attempt length calculation.

Change-Id: I62dbd78ec11095d897433754a5751c02fd0d5812
2019-03-21 09:47:17 -04:00
Jarrod Johnson
8b89c3e5a0 Fetch inventory information
Add system, cpus, adapters, memory.

Change-Id: Icb2024acca63ca94e0ff45d4cb3436f5d1564bda
2019-03-19 17:06:41 -04:00