pyghmi 1.5.75__py3-none-any.whl → 1.5.76__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyghmi/redfish/command.py +18 -2
- pyghmi/redfish/oem/generic.py +19 -6
- pyghmi/redfish/oem/lenovo/xcc.py +1 -0
- pyghmi/redfish/oem/lenovo/xcc3.py +53 -0
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/METADATA +1 -1
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/RECORD +12 -12
- pyghmi-1.5.76.dist-info/pbr.json +1 -0
- pyghmi-1.5.75.dist-info/pbr.json +0 -1
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/AUTHORS +0 -0
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/LICENSE +0 -0
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/WHEEL +0 -0
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/entry_points.txt +0 -0
- {pyghmi-1.5.75.dist-info → pyghmi-1.5.76.dist-info}/top_level.txt +0 -0
pyghmi/redfish/command.py
CHANGED
@@ -68,6 +68,7 @@ _healthmap = {
|
|
68
68
|
'Unknown': const.Health.Warning,
|
69
69
|
'Warning': const.Health.Warning,
|
70
70
|
'OK': const.Health.Ok,
|
71
|
+
None: const.Health.Ok,
|
71
72
|
}
|
72
73
|
|
73
74
|
|
@@ -123,7 +124,7 @@ class SensorReading(object):
|
|
123
124
|
self.states = [healthinfo.get('Status', {}).get('Health',
|
124
125
|
'Unknown')]
|
125
126
|
self.health = _healthmap[healthinfo['Status']['Health']]
|
126
|
-
if
|
127
|
+
if self.health == const.Health.Ok:
|
127
128
|
self.states = []
|
128
129
|
self.value = value
|
129
130
|
self.state_ids = None
|
@@ -692,7 +693,9 @@ class Command(object):
|
|
692
693
|
def _mapchassissensors(self, chassis):
|
693
694
|
chassisurl = chassis['@odata.id']
|
694
695
|
chassisinfo = self._do_web_request(chassisurl)
|
695
|
-
sensors =
|
696
|
+
sensors = None
|
697
|
+
if self.oem.usegenericsensors:
|
698
|
+
sensors = chassisinfo.get('Sensors', {}).get('@odata.id', '')
|
696
699
|
if sensors:
|
697
700
|
sensorinf = self._do_web_request(sensors)
|
698
701
|
for sensor in sensorinf.get('Members', []):
|
@@ -1379,9 +1382,18 @@ class Command(object):
|
|
1379
1382
|
if vmcoll:
|
1380
1383
|
vmlist = self._do_web_request(vmcoll)
|
1381
1384
|
vmurls = [x['@odata.id'] for x in vmlist.get('Members', [])]
|
1385
|
+
suspendedxauth = False
|
1386
|
+
if 'X-Auth-Token' in self.wc.stdheaders:
|
1387
|
+
suspendedxauth = True
|
1388
|
+
del self.wc.stdheaders['X-Auth-Token']
|
1389
|
+
self.wc.set_basic_credentials(self.username, self.password)
|
1382
1390
|
try:
|
1383
1391
|
self.oem.attach_remote_media(url, username, password, vmurls)
|
1384
1392
|
except exc.BypassGenericBehavior:
|
1393
|
+
if suspendedxauth:
|
1394
|
+
self.wc.stdheaders['X-Auth-Token'] = self.xauthtoken
|
1395
|
+
if 'Authorization' in self.wc.stdheaders:
|
1396
|
+
del self.wc.stdheaders['Authorization']
|
1385
1397
|
return
|
1386
1398
|
for vmurl in vmurls:
|
1387
1399
|
vminfo = self._do_web_request(vmurl, cache=False)
|
@@ -1403,6 +1415,10 @@ class Command(object):
|
|
1403
1415
|
else:
|
1404
1416
|
raise
|
1405
1417
|
break
|
1418
|
+
if suspendedxauth:
|
1419
|
+
self.wc.stdheaders['X-Auth-Token'] = self.xauthtoken
|
1420
|
+
if 'Authorization' in self.wc.stdheaders:
|
1421
|
+
del self.wc.stdheaders['Authorization']
|
1406
1422
|
|
1407
1423
|
def detach_remote_media(self):
|
1408
1424
|
try:
|
pyghmi/redfish/oem/generic.py
CHANGED
@@ -184,6 +184,7 @@ class AttrDependencyHandler(object):
|
|
184
184
|
|
185
185
|
class OEMHandler(object):
|
186
186
|
hostnic = None
|
187
|
+
usegenericsensors = True
|
187
188
|
|
188
189
|
def __init__(self, sysinfo, sysurl, webclient, cache, gpool=None):
|
189
190
|
self._gpool = gpool
|
@@ -787,17 +788,29 @@ class OEMHandler(object):
|
|
787
788
|
if 'Name' not in nadinfo:
|
788
789
|
continue
|
789
790
|
nicname = nadinfo['Name']
|
791
|
+
if nicname == 'NetworkAdapter':
|
792
|
+
nicname = nadinfo.get('Model', nicname)
|
790
793
|
yieldinf = {}
|
791
794
|
macidx = 1
|
792
795
|
if 'Ports' in nadinfo:
|
793
796
|
for portinfo in self._get_expanded_data(
|
794
797
|
nadinfo['Ports']['@odata.id']).get('Members', []):
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
798
|
+
ethinfo = portinfo.get('Ethernet', {})
|
799
|
+
if ethinfo:
|
800
|
+
macs = [x for x in ethinfo.get('AssociatedMACAddresses', [])]
|
801
|
+
for mac in macs:
|
802
|
+
label = 'MAC Address {}'.format(macidx)
|
803
|
+
yieldinf[label] = _normalize_mac(mac)
|
804
|
+
macidx += 1
|
805
|
+
foundmacs = True
|
806
|
+
ibinfo = portinfo.get('InfiniBand', {})
|
807
|
+
if ibinfo:
|
808
|
+
macs = [x for x in ibinfo.get('AssociatedPortGUIDs', [])]
|
809
|
+
for mac in macs:
|
810
|
+
label = 'Port GUID {}'.format(macidx)
|
811
|
+
yieldinf[label] = mac
|
812
|
+
macidx += 1
|
813
|
+
foundmacs = True
|
801
814
|
macinfobyadpname[nicname] = yieldinf
|
802
815
|
else:
|
803
816
|
for ctrlr in nadinfo.get('Controllers', []):
|
pyghmi/redfish/oem/lenovo/xcc.py
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
import copy
|
15
15
|
import json
|
16
|
+
import pyghmi.constants as pygconst
|
16
17
|
import pyghmi.redfish.oem.generic as generic
|
17
18
|
import pyghmi.exceptions as pygexc
|
18
19
|
import pyghmi.util.webclient as webclient
|
@@ -20,6 +21,22 @@ import zipfile
|
|
20
21
|
import time
|
21
22
|
import os.path
|
22
23
|
|
24
|
+
|
25
|
+
class SensorReading(object):
|
26
|
+
def __init__(self, healthinfo, sensor=None, value=None, units=None,
|
27
|
+
unavailable=False):
|
28
|
+
if sensor:
|
29
|
+
self.name = sensor['name']
|
30
|
+
else:
|
31
|
+
self.name = healthinfo['name']
|
32
|
+
self.health = healthinfo['health']
|
33
|
+
self.states = healthinfo['states']
|
34
|
+
self.state_ids = healthinfo.get('state_ids', None)
|
35
|
+
self.value = value
|
36
|
+
self.imprecision = None
|
37
|
+
self.units = units
|
38
|
+
self.unavailable = unavailable
|
39
|
+
|
23
40
|
class OEMHandler(generic.OEMHandler):
|
24
41
|
|
25
42
|
def supports_expand(self, url):
|
@@ -64,6 +81,42 @@ class OEMHandler(generic.OEMHandler):
|
|
64
81
|
powerinfo = fishclient._do_web_request('/redfish/v1/Chassis/1/Sensors/power_Sys_Power')
|
65
82
|
return powerinfo['Reading']
|
66
83
|
|
84
|
+
def get_health(self, fishclient, verbose=True):
|
85
|
+
rsp = self._do_web_request('/api/providers/imm_active_events')
|
86
|
+
summary = {'badreadings': [], 'health': pygconst.Health.Ok}
|
87
|
+
fallbackdata = []
|
88
|
+
hmap = {
|
89
|
+
0 : pygconst.Health.Ok,
|
90
|
+
3: pygconst.Health.Critical,
|
91
|
+
2: pygconst.Health.Warning,
|
92
|
+
}
|
93
|
+
infoevents = False
|
94
|
+
existingevts = set([])
|
95
|
+
for item in rsp.get('items', ()):
|
96
|
+
# while usually the ipmi interrogation shall explain things,
|
97
|
+
# just in case there is a gap, make sure at least the
|
98
|
+
# health field is accurately updated
|
99
|
+
itemseverity = hmap.get(item.get('Severity', 2),
|
100
|
+
pygconst.Health.Critical)
|
101
|
+
if itemseverity == pygconst.Health.Ok:
|
102
|
+
infoevents = True
|
103
|
+
continue
|
104
|
+
if (summary['health'] < itemseverity):
|
105
|
+
summary['health'] = itemseverity
|
106
|
+
evtsrc = item.get('Oem', {}).get('Lenovo', {}).get('Source', '')
|
107
|
+
currevt = '{}:{}'.format(evtsrc, item['Message'])
|
108
|
+
if currevt in existingevts:
|
109
|
+
continue
|
110
|
+
existingevts.add(currevt)
|
111
|
+
fallbackdata.append(SensorReading({
|
112
|
+
'name': evtsrc,
|
113
|
+
'states': [item['Message']],
|
114
|
+
'health': itemseverity,
|
115
|
+
'type': evtsrc,
|
116
|
+
}, ''))
|
117
|
+
summary['badreadings'] = fallbackdata
|
118
|
+
return summary
|
119
|
+
|
67
120
|
def _get_cpu_temps(self, fishclient):
|
68
121
|
cputemps = []
|
69
122
|
for reading in super()._get_cpu_temps(fishclient):
|
@@ -43,9 +43,9 @@ pyghmi/ipmi/private/simplesession.py,sha256=cNGaoT0uWIKDut6gUG9kAOX_b_qTzdB26R6I
|
|
43
43
|
pyghmi/ipmi/private/spd.py,sha256=oEPSXm19X2eNXDiyW_6fVjBFqhuuMAtBI9quRJgclH4,27094
|
44
44
|
pyghmi/ipmi/private/util.py,sha256=ayYodiSydlrrt0_pQppoRB1T6n-KNOiHZSfAlCMcpG0,3847
|
45
45
|
pyghmi/redfish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
|
-
pyghmi/redfish/command.py,sha256=
|
46
|
+
pyghmi/redfish/command.py,sha256=Rn2oooBAvnsGM46pS9TM7WVjDXGwrwlZY9mZqzC-97I,60741
|
47
47
|
pyghmi/redfish/oem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
48
|
-
pyghmi/redfish/oem/generic.py,sha256=
|
48
|
+
pyghmi/redfish/oem/generic.py,sha256=dwad7SwV4zYka0oKrSIBfjXu3KyFbOidVGXAW08tfAE,55691
|
49
49
|
pyghmi/redfish/oem/lookup.py,sha256=pfJW5xSkUY61OirMeYy0b1SbjBFz6IDfN5ZOYog_Yq4,1530
|
50
50
|
pyghmi/redfish/oem/dell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
51
51
|
pyghmi/redfish/oem/dell/idrac.py,sha256=pNnmqdV1sOP3ABw0xq0wF1QEO2L8onT7Osc_-sDO8EU,2146
|
@@ -54,8 +54,8 @@ pyghmi/redfish/oem/lenovo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
54
54
|
pyghmi/redfish/oem/lenovo/main.py,sha256=bnx8LuC_C4_OluNR8JSHIxtSlM4_jdBb4cUzJM6mazE,2597
|
55
55
|
pyghmi/redfish/oem/lenovo/smm3.py,sha256=FWNCR6eSK6a9ZgZ5G-HyAllYkUD5hZeO7oOVKNNslEE,3152
|
56
56
|
pyghmi/redfish/oem/lenovo/tsma.py,sha256=puSj0fO5Dt5VpDoEMVTRY95CP9q18eXcAqq7TDK350E,34633
|
57
|
-
pyghmi/redfish/oem/lenovo/xcc.py,sha256=
|
58
|
-
pyghmi/redfish/oem/lenovo/xcc3.py,sha256=
|
57
|
+
pyghmi/redfish/oem/lenovo/xcc.py,sha256=DG0GVEl_n-k77p_CFzUISLQ3AlTgppc9_yPwPy20Q4o,82735
|
58
|
+
pyghmi/redfish/oem/lenovo/xcc3.py,sha256=NYL_6akVaS5sYL6f3beHSZjWeRGlDTbAkzYojDK_G6I,19516
|
59
59
|
pyghmi/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
60
60
|
pyghmi/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
61
61
|
pyghmi/tests/unit/base.py,sha256=xWImA7zPRgfrEe2xAdRZ6w_dLwExGRBJ5CBybssUQGg,744
|
@@ -64,11 +64,11 @@ pyghmi/tests/unit/ipmi/test_sdr.py,sha256=vb3iLY0cnHJ2K_m4xgYUjEcbPd_ZYhYx-uBowB
|
|
64
64
|
pyghmi/util/__init__.py,sha256=GZLBWJiun2Plb_VE9dDSh4_PQMCha3gA7QLUqx3oSYI,25
|
65
65
|
pyghmi/util/parse.py,sha256=6VlyBCEcE8gy8PJWmEDdtCyWATaKwPaTswCdioPCWOE,2120
|
66
66
|
pyghmi/util/webclient.py,sha256=782_yMuy_LuN9E2vh2EJ-R64X_EyvLLRuurE__jfn20,15371
|
67
|
-
pyghmi-1.5.
|
68
|
-
pyghmi-1.5.
|
69
|
-
pyghmi-1.5.
|
70
|
-
pyghmi-1.5.
|
71
|
-
pyghmi-1.5.
|
72
|
-
pyghmi-1.5.
|
73
|
-
pyghmi-1.5.
|
74
|
-
pyghmi-1.5.
|
67
|
+
pyghmi-1.5.76.dist-info/AUTHORS,sha256=-0iHKtdQwAJfAGKcruCnvcQXrXuE_LgBZ3P15DJI1xY,2044
|
68
|
+
pyghmi-1.5.76.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
69
|
+
pyghmi-1.5.76.dist-info/METADATA,sha256=1__ebGoQR_mgCzeiVv6VwBIcV9zh-ealhXSjKe_VseE,1137
|
70
|
+
pyghmi-1.5.76.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
71
|
+
pyghmi-1.5.76.dist-info/entry_points.txt,sha256=-OpJliDzATxmuPXK0VR3Ma-Yk_i4ZhfIIB-12A26dSI,168
|
72
|
+
pyghmi-1.5.76.dist-info/pbr.json,sha256=7P9y3sOyYyYsFR7KO_P8o4k1UQpTfZtkxoIp2PRUYv8,46
|
73
|
+
pyghmi-1.5.76.dist-info/top_level.txt,sha256=aDtt6S9eVu6-tNdaUs4Pz9PbdUd69bziZZMhNvk9Ulc,7
|
74
|
+
pyghmi-1.5.76.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
{"git_version": "345fd8b", "is_release": true}
|
pyghmi-1.5.75.dist-info/pbr.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"git_version": "8666417", "is_release": true}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|