pyghmi 1.6.2__tar.gz → 1.6.3__tar.gz

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.
Files changed (107) hide show
  1. {pyghmi-1.6.2 → pyghmi-1.6.3}/ChangeLog +7 -0
  2. {pyghmi-1.6.2 → pyghmi-1.6.3}/PKG-INFO +1 -1
  3. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/session.py +4 -0
  4. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lenovo/xcc3.py +28 -6
  5. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/util/webclient.py +7 -6
  6. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/PKG-INFO +1 -1
  7. pyghmi-1.6.3/pyghmi.egg-info/pbr.json +1 -0
  8. pyghmi-1.6.2/pyghmi.egg-info/pbr.json +0 -1
  9. {pyghmi-1.6.2 → pyghmi-1.6.3}/.coveragerc +0 -0
  10. {pyghmi-1.6.2 → pyghmi-1.6.3}/.stestr.conf +0 -0
  11. {pyghmi-1.6.2 → pyghmi-1.6.3}/AUTHORS +0 -0
  12. {pyghmi-1.6.2 → pyghmi-1.6.3}/CONTRIBUTING.rst +0 -0
  13. {pyghmi-1.6.2 → pyghmi-1.6.3}/LICENSE +0 -0
  14. {pyghmi-1.6.2 → pyghmi-1.6.3}/MANIFEST.in +0 -0
  15. {pyghmi-1.6.2 → pyghmi-1.6.3}/README +0 -0
  16. {pyghmi-1.6.2 → pyghmi-1.6.3}/README.md +0 -0
  17. {pyghmi-1.6.2 → pyghmi-1.6.3}/builddeb +0 -0
  18. {pyghmi-1.6.2 → pyghmi-1.6.3}/buildrpm +0 -0
  19. {pyghmi-1.6.2 → pyghmi-1.6.3}/doc/requirements.txt +0 -0
  20. {pyghmi-1.6.2 → pyghmi-1.6.3}/doc/source/conf.py +0 -0
  21. {pyghmi-1.6.2 → pyghmi-1.6.3}/doc/source/contributor/index.rst +0 -0
  22. {pyghmi-1.6.2 → pyghmi-1.6.3}/doc/source/index.rst +0 -0
  23. {pyghmi-1.6.2 → pyghmi-1.6.3}/doc/source/install/index.rst +0 -0
  24. {pyghmi-1.6.2 → pyghmi-1.6.3}/doc/source/reference/index.rst +0 -0
  25. {pyghmi-1.6.2 → pyghmi-1.6.3}/makesetup +0 -0
  26. {pyghmi-1.6.2 → pyghmi-1.6.3}/playbooks/legacy/tempest-devstack-ironic-pxe_ipmitool-pyghmi-src/post.yaml +0 -0
  27. {pyghmi-1.6.2 → pyghmi-1.6.3}/playbooks/legacy/tempest-devstack-ironic-pxe_ipmitool-pyghmi-src/run.yaml +0 -0
  28. {pyghmi-1.6.2 → pyghmi-1.6.3}/py27-constraints.txt +0 -0
  29. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/__init__.py +0 -0
  30. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/cmd/__init__.py +0 -0
  31. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/cmd/fakebmc.py +0 -0
  32. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/cmd/pyghmicons.py +0 -0
  33. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/cmd/pyghmiutil.py +0 -0
  34. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/cmd/virshbmc.py +0 -0
  35. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/constants.py +0 -0
  36. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/exceptions.py +0 -0
  37. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/__init__.py +0 -0
  38. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/bmc.py +0 -0
  39. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/command.py +0 -0
  40. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/console.py +0 -0
  41. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/events.py +0 -0
  42. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/fru.py +0 -0
  43. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/__init__.py +0 -0
  44. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/generic.py +0 -0
  45. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/__init__.py +0 -0
  46. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/config.py +0 -0
  47. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/cpu.py +0 -0
  48. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/dimm.py +0 -0
  49. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/drive.py +0 -0
  50. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/energy.py +0 -0
  51. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/firmware.py +0 -0
  52. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/handler.py +0 -0
  53. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/imm.py +0 -0
  54. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/inventory.py +0 -0
  55. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/nextscale.py +0 -0
  56. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/pci.py +0 -0
  57. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/psu.py +0 -0
  58. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/raid_controller.py +0 -0
  59. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lenovo/raid_drive.py +0 -0
  60. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/oem/lookup.py +0 -0
  61. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/__init__.py +0 -0
  62. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/constants.py +0 -0
  63. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/localsession.py +0 -0
  64. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/serversession.py +0 -0
  65. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/simplesession.py +0 -0
  66. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/spd.py +0 -0
  67. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/private/util.py +0 -0
  68. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/ipmi/sdr.py +0 -0
  69. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/media.py +0 -0
  70. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/__init__.py +0 -0
  71. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/command.py +0 -0
  72. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/__init__.py +0 -0
  73. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/dell/__init__.py +0 -0
  74. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/dell/idrac.py +0 -0
  75. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/dell/main.py +0 -0
  76. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/generic.py +0 -0
  77. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lenovo/__init__.py +0 -0
  78. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lenovo/main.py +0 -0
  79. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lenovo/smm3.py +0 -0
  80. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lenovo/tsma.py +0 -0
  81. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lenovo/xcc.py +0 -0
  82. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/redfish/oem/lookup.py +0 -0
  83. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/storage.py +0 -0
  84. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/tests/__init__.py +0 -0
  85. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/tests/unit/__init__.py +0 -0
  86. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/tests/unit/base.py +0 -0
  87. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/tests/unit/ipmi/__init__.py +0 -0
  88. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/tests/unit/ipmi/test_sdr.py +0 -0
  89. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/util/__init__.py +0 -0
  90. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/util/parse.py +0 -0
  91. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi/version.py +0 -0
  92. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/SOURCES.txt +0 -0
  93. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/dependency_links.txt +0 -0
  94. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/entry_points.txt +0 -0
  95. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/not-zip-safe +0 -0
  96. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/requires.txt +0 -0
  97. {pyghmi-1.6.2 → pyghmi-1.6.3}/pyghmi.egg-info/top_level.txt +0 -0
  98. {pyghmi-1.6.2 → pyghmi-1.6.3}/python-pyghmi.spec +0 -0
  99. {pyghmi-1.6.2 → pyghmi-1.6.3}/python-pyghmi.spec.tmpl +0 -0
  100. {pyghmi-1.6.2 → pyghmi-1.6.3}/requirements.txt +0 -0
  101. {pyghmi-1.6.2 → pyghmi-1.6.3}/setup.cfg +0 -0
  102. {pyghmi-1.6.2 → pyghmi-1.6.3}/setup.py +0 -0
  103. {pyghmi-1.6.2 → pyghmi-1.6.3}/setup.py.tmpl +0 -0
  104. {pyghmi-1.6.2 → pyghmi-1.6.3}/test-requirements.txt +0 -0
  105. {pyghmi-1.6.2 → pyghmi-1.6.3}/tox.ini +0 -0
  106. {pyghmi-1.6.2 → pyghmi-1.6.3}/wheezy.patch +0 -0
  107. {pyghmi-1.6.2 → pyghmi-1.6.3}/zuul.d/project.yaml +0 -0
@@ -1,6 +1,13 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ 1.6.3
5
+ -----
6
+
7
+ * Fixes to XCC3 module
8
+ * Randomize boundary
9
+ * Increase buffer size
10
+
4
11
  1.6.2
5
12
  -----
6
13
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyghmi
3
- Version: 1.6.2
3
+ Version: 1.6.3
4
4
  Summary: Python General Hardware Management Initiative (IPMI and others)
5
5
  Home-page: http://github.com/openstack/pyghmi/
6
6
  Author: Jarrod Johnson
@@ -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
- datacache = {}
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
- bdata['MAC Address {0}'.format(port['Id'])] = port['Ethernet']['AssociatedMACAddresses'][0].lower()
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
- raise pygexc.InvalidParameterValue(
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 = {}
@@ -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'--' + BND
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'--' + BND
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--' + BND + 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=' + BND
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyghmi
3
- Version: 1.6.2
3
+ Version: 1.6.3
4
4
  Summary: Python General Hardware Management Initiative (IPMI and others)
5
5
  Home-page: http://github.com/openstack/pyghmi/
6
6
  Author: Jarrod Johnson
@@ -0,0 +1 @@
1
+ {"git_version": "58cf3ce", "is_release": true}
@@ -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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes