pyghmi 1.6.2__py3-none-any.whl → 1.6.3__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/ipmi/private/session.py +4 -0
- pyghmi/redfish/oem/lenovo/xcc3.py +28 -6
- pyghmi/util/webclient.py +7 -6
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/METADATA +1 -1
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/RECORD +11 -11
- pyghmi-1.6.3.dist-info/pbr.json +1 -0
- pyghmi-1.6.2.dist-info/pbr.json +0 -1
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/AUTHORS +0 -0
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/LICENSE +0 -0
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/WHEEL +0 -0
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/entry_points.txt +0 -0
- {pyghmi-1.6.2.dist-info → pyghmi-1.6.3.dist-info}/top_level.txt +0 -0
pyghmi/ipmi/private/session.py
CHANGED
@@ -375,6 +375,10 @@ class Session(object):
|
|
375
375
|
tmpsocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
376
376
|
else:
|
377
377
|
tmpsocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
378
|
+
try:
|
379
|
+
tmpsocket.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 16777216)
|
380
|
+
except Exception:
|
381
|
+
pass
|
378
382
|
if server is None:
|
379
383
|
# Rather than wait until send() to bind, bind now so that we have
|
380
384
|
# a port number allocated no matter what
|
@@ -64,7 +64,11 @@ class SensorReading(object):
|
|
64
64
|
|
65
65
|
class OEMHandler(generic.OEMHandler):
|
66
66
|
|
67
|
-
|
67
|
+
def __init__(self, sysinfo, sysurl, webclient, cache, gpool=None):
|
68
|
+
super(OEMHandler, self).__init__(sysinfo, sysurl, webclient, cache,
|
69
|
+
gpool)
|
70
|
+
self.datacache = {}
|
71
|
+
|
68
72
|
|
69
73
|
def supports_expand(self, url):
|
70
74
|
return True
|
@@ -115,8 +119,8 @@ class OEMHandler(generic.OEMHandler):
|
|
115
119
|
# raise pygexc.TemporaryError(
|
116
120
|
# 'Cannot read extended inventory during firmware update')
|
117
121
|
if self.webclient:
|
118
|
-
adapterdata = self._do_bulk_requests([i['@odata.id'] for i in self.webclient.grab_json_response(
|
119
|
-
'/redfish/v1/Chassis/1')['Links']['PCIeDevices']])
|
122
|
+
adapterdata = list(self._do_bulk_requests([i['@odata.id'] for i in self.webclient.grab_json_response(
|
123
|
+
'/redfish/v1/Chassis/1')['Links']['PCIeDevices']]))
|
120
124
|
if adapterdata:
|
121
125
|
self.datacache['lenovo_cached_adapters'] = (
|
122
126
|
adapterdata, util._monotonic_time())
|
@@ -164,8 +168,21 @@ class OEMHandler(generic.OEMHandler):
|
|
164
168
|
# Could be identified also through Oem->Lenovo->FunctionClass
|
165
169
|
if fundata['Members'][0]['DeviceClass'] == 'NetworkController':
|
166
170
|
ports_data = self._get_expanded_data('{0}/Ports'.format(adata['@odata.id'].replace('PCIeDevices','NetworkAdapters')))
|
171
|
+
macidx = 1
|
167
172
|
for port in ports_data['Members']:
|
168
|
-
|
173
|
+
if port.get('Ethernet', None):
|
174
|
+
macs = [x for x in port['Ethernet'].get('AssociatedMACAddresses', [])]
|
175
|
+
for mac in macs:
|
176
|
+
label = 'MAC Address {}'.format(macidx)
|
177
|
+
bdata[label] = generic._normalize_mac(mac)
|
178
|
+
macidx += 1
|
179
|
+
ibinfo = port.get('InfiniBand', {})
|
180
|
+
if ibinfo:
|
181
|
+
macs = [x for x in ibinfo.get('AssociatedPortGUIDs', [])]
|
182
|
+
for mac in macs:
|
183
|
+
label = 'Port GUID {}'.format(macidx)
|
184
|
+
bdata[label] = mac
|
185
|
+
macidx += 1
|
169
186
|
hwmap[aname] = bdata
|
170
187
|
self.datacache['lenovo_cached_hwmap'] = (hwmap,
|
171
188
|
util._monotonic_time())
|
@@ -924,11 +941,15 @@ class OEMHandler(generic.OEMHandler):
|
|
924
941
|
src, dst = currval.split(',')
|
925
942
|
mappings.append('{}:{}'.format(src,dst))
|
926
943
|
settings['usb_forwarded_ports'] = {'value': ','.join(mappings)}
|
944
|
+
cfgin = self._get_lnv_bmcstgs(self)[0]
|
945
|
+
for stgname in cfgin:
|
946
|
+
settings[f'{stgname}'] = cfgin[stgname]
|
927
947
|
return settings
|
928
948
|
|
929
949
|
def set_bmc_configuration(self, changeset):
|
930
950
|
acctattribs = {}
|
931
951
|
usbsettings = {}
|
952
|
+
bmchangeset = {}
|
932
953
|
for key in changeset:
|
933
954
|
if isinstance(changeset[key], str):
|
934
955
|
changeset[key] = {'value': changeset[key]}
|
@@ -963,14 +984,15 @@ class OEMHandler(generic.OEMHandler):
|
|
963
984
|
'usb_forwarded_ports'):
|
964
985
|
usbsettings[key] = currval
|
965
986
|
else:
|
966
|
-
|
967
|
-
'{0} not a known setting'.format(key))
|
987
|
+
bmchangeset[key.replace('bmc.', '')] = changeset[key]
|
968
988
|
if acctattribs:
|
969
989
|
self._do_web_request(
|
970
990
|
'/redfish/v1/AccountService', acctattribs, method='PATCH')
|
971
991
|
self._do_web_request('/redfish/v1/AccountService', cache=False)
|
972
992
|
if usbsettings:
|
973
993
|
self.apply_usb_configuration(usbsettings)
|
994
|
+
if bmchangeset:
|
995
|
+
self._set_xcc3_settings(bmchangeset, self)
|
974
996
|
|
975
997
|
def apply_usb_configuration(self, usbsettings):
|
976
998
|
bmcattribs = {}
|
pyghmi/util/webclient.py
CHANGED
@@ -96,7 +96,7 @@ class FileDownloader(threading.Thread):
|
|
96
96
|
self.exc = e
|
97
97
|
|
98
98
|
|
99
|
-
def get_upload_form(filename, data, formname, otherfields):
|
99
|
+
def get_upload_form(filename, data, formname, otherfields, boundary=BND):
|
100
100
|
ffilename = filename.split('/')[-1]
|
101
101
|
if not formname:
|
102
102
|
formname = ffilename
|
@@ -114,16 +114,16 @@ def get_upload_form(filename, data, formname, otherfields):
|
|
114
114
|
if isinstance(tfield, dict):
|
115
115
|
tfield = json.dumps(tfield)
|
116
116
|
xtra = '\r\nContent-Type: application/json'
|
117
|
-
form += (b'--' +
|
117
|
+
form += (b'--' + boundary
|
118
118
|
+ '\r\nContent-Disposition: form-data; '
|
119
119
|
'name="{0}"{1}\r\n\r\n{2}\r\n'.format(
|
120
120
|
ofield, xtra, tfield).encode('utf-8'))
|
121
|
-
form += (b'--' +
|
121
|
+
form += (b'--' + boundary
|
122
122
|
+ '\r\nContent-Disposition: form-data; '
|
123
123
|
'name="{0}"; filename="{1}"\r\n'.format(
|
124
124
|
formname, ffilename).encode('utf-8'))
|
125
125
|
form += b'Content-Type: application/octet-stream\r\n\r\n' + data
|
126
|
-
form += b'\r\n--' +
|
126
|
+
form += b'\r\n--' + boundary + b'--\r\n'
|
127
127
|
uploadforms[filename] = form
|
128
128
|
return form
|
129
129
|
|
@@ -332,13 +332,14 @@ class SecureHTTPConnection(httplib.HTTPConnection, object):
|
|
332
332
|
the file.
|
333
333
|
:return:
|
334
334
|
"""
|
335
|
+
boundary = base64.b64encode(os.urandom(54))[:70]
|
335
336
|
if data is None:
|
336
337
|
data = open(filename, 'rb')
|
337
338
|
ulhdrs = self.stdheaders.copy()
|
338
339
|
if formwrap:
|
339
340
|
self._upbuffer = io.BytesIO(get_upload_form(
|
340
|
-
filename, data, formname, otherfields))
|
341
|
-
ulhdrs['Content-Type'] = b'multipart/form-data; boundary=' +
|
341
|
+
filename, data, formname, otherfields, boundary))
|
342
|
+
ulhdrs['Content-Type'] = b'multipart/form-data; boundary=' + boundary
|
342
343
|
ulhdrs['Content-Length'] = len(uploadforms[filename])
|
343
344
|
self.ulsize = len(uploadforms[filename])
|
344
345
|
else:
|
@@ -38,7 +38,7 @@ pyghmi/ipmi/private/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
38
38
|
pyghmi/ipmi/private/constants.py,sha256=ViuB_nXsMM5LjkT9FGf2it2KQKvEehd5cZJgewjmVds,66936
|
39
39
|
pyghmi/ipmi/private/localsession.py,sha256=DThuwgvsAJT2AQ8byg4TA8AZG4hBBHnT-pxIJRsISCE,4879
|
40
40
|
pyghmi/ipmi/private/serversession.py,sha256=H5toINVu7sEuc13MWJHVG3zqNCyMY1tYXjQ4ZOOjQfE,16411
|
41
|
-
pyghmi/ipmi/private/session.py,sha256=
|
41
|
+
pyghmi/ipmi/private/session.py,sha256=d6Mk6bPN-2B53dm_AQ4cVk99noEKqlGRcGJamarWzsQ,81933
|
42
42
|
pyghmi/ipmi/private/simplesession.py,sha256=cNGaoT0uWIKDut6gUG9kAOX_b_qTzdB26R6I6Qk7cns,58834
|
43
43
|
pyghmi/ipmi/private/spd.py,sha256=oEPSXm19X2eNXDiyW_6fVjBFqhuuMAtBI9quRJgclH4,27094
|
44
44
|
pyghmi/ipmi/private/util.py,sha256=ayYodiSydlrrt0_pQppoRB1T6n-KNOiHZSfAlCMcpG0,3847
|
@@ -55,7 +55,7 @@ pyghmi/redfish/oem/lenovo/main.py,sha256=bnx8LuC_C4_OluNR8JSHIxtSlM4_jdBb4cUzJM6
|
|
55
55
|
pyghmi/redfish/oem/lenovo/smm3.py,sha256=W3PKHpFNj5Ujql-neWTH3UgYGDZXQlBvC1aRX97GV8A,5982
|
56
56
|
pyghmi/redfish/oem/lenovo/tsma.py,sha256=6GELCuriumARj_kv7fgqtUpo9ekiWHpQcM9v_mnGILI,34645
|
57
57
|
pyghmi/redfish/oem/lenovo/xcc.py,sha256=78ksNj2-0jquj61lmAZldy3DdcR5KndqbLQ2Y4ZSFOM,84234
|
58
|
-
pyghmi/redfish/oem/lenovo/xcc3.py,sha256=
|
58
|
+
pyghmi/redfish/oem/lenovo/xcc3.py,sha256=Uu6VjvUNZgNkAW5slEGckFR55htALbrxvVUjkIy-1g8,55678
|
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
|
@@ -63,12 +63,12 @@ pyghmi/tests/unit/ipmi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
63
63
|
pyghmi/tests/unit/ipmi/test_sdr.py,sha256=vb3iLY0cnHJ2K_m4xgYUjEcbPd_ZYhYx-uBowByplXw,824
|
64
64
|
pyghmi/util/__init__.py,sha256=GZLBWJiun2Plb_VE9dDSh4_PQMCha3gA7QLUqx3oSYI,25
|
65
65
|
pyghmi/util/parse.py,sha256=6VlyBCEcE8gy8PJWmEDdtCyWATaKwPaTswCdioPCWOE,2120
|
66
|
-
pyghmi/util/webclient.py,sha256=
|
67
|
-
pyghmi-1.6.
|
68
|
-
pyghmi-1.6.
|
69
|
-
pyghmi-1.6.
|
70
|
-
pyghmi-1.6.
|
71
|
-
pyghmi-1.6.
|
72
|
-
pyghmi-1.6.
|
73
|
-
pyghmi-1.6.
|
74
|
-
pyghmi-1.6.
|
66
|
+
pyghmi/util/webclient.py,sha256=Sw-XQI0udlD22pdCMOBPvv42KMtLV4a3noYY9v_Muzw,15472
|
67
|
+
pyghmi-1.6.3.dist-info/AUTHORS,sha256=yv4aQom_PII-SNqbeeKrfH-spcG85PRPsZ71Iqjl_fU,2083
|
68
|
+
pyghmi-1.6.3.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
69
|
+
pyghmi-1.6.3.dist-info/METADATA,sha256=nYZYXWlA0oLwsa438e0NOFvPrd_XMrR7-ZURkEK7D3E,1136
|
70
|
+
pyghmi-1.6.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
71
|
+
pyghmi-1.6.3.dist-info/entry_points.txt,sha256=-OpJliDzATxmuPXK0VR3Ma-Yk_i4ZhfIIB-12A26dSI,168
|
72
|
+
pyghmi-1.6.3.dist-info/pbr.json,sha256=vB_8gvy6-F0qrwot79vigX7I5YKQFLwLkZqGWdkJErA,46
|
73
|
+
pyghmi-1.6.3.dist-info/top_level.txt,sha256=aDtt6S9eVu6-tNdaUs4Pz9PbdUd69bziZZMhNvk9Ulc,7
|
74
|
+
pyghmi-1.6.3.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
{"git_version": "58cf3ce", "is_release": true}
|
pyghmi-1.6.2.dist-info/pbr.json
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"git_version": "6bf4e17", "is_release": true}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|