pyghmi 1.5.71__tar.gz → 1.5.72__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {pyghmi-1.5.71 → pyghmi-1.5.72}/ChangeLog +12 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/PKG-INFO +1 -1
- {pyghmi-1.5.71 → pyghmi-1.5.72}/builddeb +5 -2
- pyghmi-1.5.72/makesetup +14 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/command.py +3 -17
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/generic.py +69 -37
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/lenovo/main.py +14 -1
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/lenovo/xcc.py +2 -2
- pyghmi-1.5.72/pyghmi/redfish/oem/lenovo/xcc3.py +137 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/PKG-INFO +1 -1
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/SOURCES.txt +1 -0
- pyghmi-1.5.72/pyghmi.egg-info/pbr.json +1 -0
- pyghmi-1.5.71/makesetup +0 -10
- pyghmi-1.5.71/pyghmi.egg-info/pbr.json +0 -1
- {pyghmi-1.5.71 → pyghmi-1.5.72}/.coveragerc +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/.stestr.conf +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/AUTHORS +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/CONTRIBUTING.rst +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/LICENSE +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/MANIFEST.in +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/README +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/README.md +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/buildrpm +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/doc/requirements.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/doc/source/conf.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/doc/source/contributor/index.rst +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/doc/source/index.rst +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/doc/source/install/index.rst +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/doc/source/reference/index.rst +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/playbooks/legacy/tempest-devstack-ironic-pxe_ipmitool-pyghmi-src/post.yaml +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/playbooks/legacy/tempest-devstack-ironic-pxe_ipmitool-pyghmi-src/run.yaml +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/py27-constraints.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/cmd/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/cmd/fakebmc.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/cmd/pyghmicons.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/cmd/pyghmiutil.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/cmd/virshbmc.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/constants.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/exceptions.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/bmc.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/command.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/console.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/events.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/fru.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/generic.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/config.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/cpu.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/dimm.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/drive.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/energy.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/firmware.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/handler.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/imm.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/inventory.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/nextscale.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/pci.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/psu.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/raid_controller.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lenovo/raid_drive.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/oem/lookup.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/constants.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/localsession.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/serversession.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/session.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/simplesession.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/spd.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/private/util.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/ipmi/sdr.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/media.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/dell/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/dell/idrac.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/dell/main.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/lenovo/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/lenovo/tsma.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/redfish/oem/lookup.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/storage.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/tests/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/tests/unit/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/tests/unit/base.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/tests/unit/ipmi/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/tests/unit/ipmi/test_sdr.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/util/__init__.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/util/parse.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/util/webclient.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi/version.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/dependency_links.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/entry_points.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/not-zip-safe +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/requires.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/pyghmi.egg-info/top_level.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/python-pyghmi.spec +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/python-pyghmi.spec.tmpl +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/requirements.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/setup.cfg +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/setup.py +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/setup.py.tmpl +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/test-requirements.txt +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/tox.ini +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/wheezy.patch +0 -0
- {pyghmi-1.5.71 → pyghmi-1.5.72}/zuul.d/project.yaml +0 -0
@@ -1,6 +1,18 @@
|
|
1
1
|
CHANGES
|
2
2
|
=======
|
3
3
|
|
4
|
+
1.5.72
|
5
|
+
------
|
6
|
+
|
7
|
+
* Rework get description to enable it to work fer XCC3
|
8
|
+
* Modify build for snap versions
|
9
|
+
* Amend deb package build to avoid extranoeus content
|
10
|
+
* Use approved method to determine XCC vintage
|
11
|
+
* Implement fixup of firmware inventory
|
12
|
+
* Prefer XCC3 detection over XCC2
|
13
|
+
* Fix str concatenation on redfish spec violations
|
14
|
+
* Refactor redfish settings and leverage in XCC3
|
15
|
+
|
4
16
|
1.5.71
|
5
17
|
------
|
6
18
|
|
@@ -11,7 +11,10 @@ if grep wheezy /etc/os-release; then
|
|
11
11
|
export DSCARGS=""
|
12
12
|
fi
|
13
13
|
# If not PBR, use the setup.py.tmpl
|
14
|
-
|
14
|
+
sed -e 's/~/./' ./makesetup > ./makesetup.deb
|
15
|
+
chmod +x ./makesetup.deb
|
16
|
+
./makesetup.deb
|
17
|
+
#$PYEXEC -c 'import pbr' || ./makesetup
|
15
18
|
VERSION=`$PYEXEC setup.py --version`
|
16
19
|
$PYEXEC setup.py sdist
|
17
20
|
py2dsc $DSCARGS dist/pyghmi-$VERSION.tar.gz
|
@@ -21,4 +24,4 @@ dpkg-buildpackage -rfakeroot -uc -us -i
|
|
21
24
|
cd -
|
22
25
|
rm -rf $(find deb_dist -mindepth 1 -maxdepth 1 -type d)
|
23
26
|
rm $1/*pyghmi*
|
24
|
-
cp deb_dist
|
27
|
+
cp deb_dist/*.deb $1/
|
pyghmi-1.5.72/makesetup
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
cd `dirname $0`
|
3
|
+
VERSION=`git describe|cut -d- -f 1`
|
4
|
+
NUMCOMMITS=`git describe|cut -d- -f 2`
|
5
|
+
if [ "$NUMCOMMITS" != "$VERSION" ]; then
|
6
|
+
LASTNUM=$(echo $VERSION|rev|cut -d . -f 1|rev)
|
7
|
+
LASTNUM=$((LASTNUM+1))
|
8
|
+
FIRSTPART=$(echo $VERSION|rev|cut -d . -f 2- |rev)
|
9
|
+
VERSION=${FIRSTPART}.${LASTNUM}
|
10
|
+
VERSION=$VERSION~dev$NUMCOMMITS+`git describe|cut -d- -f 3`
|
11
|
+
fi
|
12
|
+
echo $VERSION > VERSION
|
13
|
+
sed -e "s/#VERSION#/$VERSION/" setup.py.tmpl > setup.py
|
14
|
+
|
@@ -81,20 +81,6 @@ def _mask_to_cidr(mask):
|
|
81
81
|
return cidr
|
82
82
|
|
83
83
|
|
84
|
-
def _to_boolean(attrval):
|
85
|
-
attrval = attrval.lower()
|
86
|
-
if not attrval:
|
87
|
-
return False
|
88
|
-
if ('true'.startswith(attrval) or 'yes'.startswith(attrval)
|
89
|
-
or 'enabled'.startswith(attrval) or attrval == '1'):
|
90
|
-
return True
|
91
|
-
if ('false'.startswith(attrval) or 'no'.startswith(attrval)
|
92
|
-
or 'disabled'.startswith(attrval) or attrval == '0'):
|
93
|
-
return False
|
94
|
-
raise Exception(
|
95
|
-
'Unrecognized candidate for boolean: {0}'.format(attrval))
|
96
|
-
|
97
|
-
|
98
84
|
def _cidr_to_mask(cidr):
|
99
85
|
return socket.inet_ntop(
|
100
86
|
socket.AF_INET, struct.pack(
|
@@ -547,7 +533,7 @@ class Command(object):
|
|
547
533
|
msgid = ','.join(msgid)
|
548
534
|
raise exc.RedfishError(errmsg, msgid=msgid)
|
549
535
|
except (ValueError, KeyError):
|
550
|
-
raise exc.PyghmiException(str(url) + ":" + res[0])
|
536
|
+
raise exc.PyghmiException(str(url) + ":" + str(res[0]))
|
551
537
|
if payload is None and method is None:
|
552
538
|
self._urlcache[url] = {'contents': res[0],
|
553
539
|
'vintage': os.times()[4]}
|
@@ -977,7 +963,7 @@ class Command(object):
|
|
977
963
|
|
978
964
|
def get_firmware(self, components=()):
|
979
965
|
try:
|
980
|
-
for firminfo in self.oem.get_firmware_inventory(components):
|
966
|
+
for firminfo in self.oem.get_firmware_inventory(components, self):
|
981
967
|
yield firminfo
|
982
968
|
except exc.BypassGenericBehavior:
|
983
969
|
return
|
@@ -1092,7 +1078,7 @@ class Command(object):
|
|
1092
1078
|
return self._oem
|
1093
1079
|
|
1094
1080
|
def get_description(self):
|
1095
|
-
return self.oem.get_description()
|
1081
|
+
return self.oem.get_description(self)
|
1096
1082
|
|
1097
1083
|
def get_event_log(self, clear=False):
|
1098
1084
|
bmcinfo = self._do_web_request(self._bmcurl)
|
@@ -44,11 +44,29 @@ class SensorReading(object):
|
|
44
44
|
self.units = units
|
45
45
|
self.unavailable = unavailable
|
46
46
|
|
47
|
+
|
48
|
+
def _to_boolean(attrval):
|
49
|
+
attrval = attrval.lower()
|
50
|
+
if not attrval:
|
51
|
+
return False
|
52
|
+
if ('true'.startswith(attrval) or 'yes'.startswith(attrval)
|
53
|
+
or 'enabled'.startswith(attrval) or attrval == '1'):
|
54
|
+
return True
|
55
|
+
if ('false'.startswith(attrval) or 'no'.startswith(attrval)
|
56
|
+
or 'disabled'.startswith(attrval) or attrval == '0'):
|
57
|
+
return False
|
58
|
+
raise Exception(
|
59
|
+
'Unrecognized candidate for boolean: {0}'.format(attrval))
|
60
|
+
|
61
|
+
|
47
62
|
def _normalize_mac(mac):
|
48
63
|
if ':' not in mac:
|
49
|
-
mac = ':'.join((
|
64
|
+
mac = ':'.join((
|
65
|
+
mac[:2], mac[2:4], mac[4:6],
|
66
|
+
mac[6:8], mac[8:10], mac[10:12]))
|
50
67
|
return mac.lower()
|
51
68
|
|
69
|
+
|
52
70
|
_healthmap = {
|
53
71
|
'Critical': const.Health.Critical,
|
54
72
|
'Unknown': const.Health.Warning,
|
@@ -345,6 +363,38 @@ class OEMHandler(object):
|
|
345
363
|
def get_system_configuration(self, hideadvanced=True, fishclient=None):
|
346
364
|
return self._getsyscfg(fishclient)[0]
|
347
365
|
|
366
|
+
def _get_attrib_registry(self, fishclient, attribreg):
|
367
|
+
overview = fishclient._do_web_request('/redfish/v1/')
|
368
|
+
reglist = overview['Registries']['@odata.id']
|
369
|
+
reglist = fishclient._do_web_request(reglist)
|
370
|
+
regurl = None
|
371
|
+
for cand in reglist.get('Members', []):
|
372
|
+
cand = cand.get('@odata.id', '')
|
373
|
+
candname = cand.split('/')[-1]
|
374
|
+
if candname == '': # implementation uses trailing slash
|
375
|
+
candname = cand.split('/')[-2]
|
376
|
+
if candname == attribreg:
|
377
|
+
regurl = cand
|
378
|
+
break
|
379
|
+
if not regurl:
|
380
|
+
# Workaround a vendor bug where they link to a
|
381
|
+
# non-existant name
|
382
|
+
for cand in reglist.get('Members', []):
|
383
|
+
cand = cand.get('@odata.id', '')
|
384
|
+
candname = cand.split('/')[-1]
|
385
|
+
candname = candname.split('.')[0]
|
386
|
+
if candname == attribreg.split('.')[0]:
|
387
|
+
regurl = cand
|
388
|
+
break
|
389
|
+
if regurl:
|
390
|
+
reginfo = fishclient._do_web_request(regurl)
|
391
|
+
for reg in reginfo.get('Location', []):
|
392
|
+
if reg.get('Language', 'en').startswith('en'):
|
393
|
+
reguri = reg['Uri']
|
394
|
+
reginfo = self._get_biosreg(reguri, fishclient)
|
395
|
+
return reginfo
|
396
|
+
extrainfo, valtodisplay, _, self.attrdeps = reginfo
|
397
|
+
|
348
398
|
def _getsyscfg(self, fishclient):
|
349
399
|
biosinfo = self._do_web_request(fishclient._biosurl, cache=False)
|
350
400
|
reginfo = ({}, {}, {}, {})
|
@@ -352,36 +402,9 @@ class OEMHandler(object):
|
|
352
402
|
valtodisplay = {}
|
353
403
|
self.attrdeps = {'Dependencies': [], 'Attributes': []}
|
354
404
|
if 'AttributeRegistry' in biosinfo:
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
regurl = None
|
359
|
-
for cand in reglist.get('Members', []):
|
360
|
-
cand = cand.get('@odata.id', '')
|
361
|
-
candname = cand.split('/')[-1]
|
362
|
-
if candname == '': # implementation uses trailing slash
|
363
|
-
candname = cand.split('/')[-2]
|
364
|
-
if candname == biosinfo['AttributeRegistry']:
|
365
|
-
regurl = cand
|
366
|
-
break
|
367
|
-
if not regurl:
|
368
|
-
# Workaround a vendor bug where they link to a
|
369
|
-
# non-existant name
|
370
|
-
for cand in reglist.get('Members', []):
|
371
|
-
cand = cand.get('@odata.id', '')
|
372
|
-
candname = cand.split('/')[-1]
|
373
|
-
candname = candname.split('.')[0]
|
374
|
-
if candname == biosinfo[
|
375
|
-
'AttributeRegistry'].split('.')[0]:
|
376
|
-
regurl = cand
|
377
|
-
break
|
378
|
-
if regurl:
|
379
|
-
reginfo = fishclient._do_web_request(regurl)
|
380
|
-
for reg in reginfo.get('Location', []):
|
381
|
-
if reg.get('Language', 'en').startswith('en'):
|
382
|
-
reguri = reg['Uri']
|
383
|
-
reginfo = self._get_biosreg(reguri, fishclient)
|
384
|
-
extrainfo, valtodisplay, _, self.attrdeps = reginfo
|
405
|
+
reginfo = self._get_attrib_registry(fishclient, biosinfo['AttributeRegistry'])
|
406
|
+
if reginfo:
|
407
|
+
extrainfo, valtodisplay, _, self.attrdeps = reginfo
|
385
408
|
currsettings = {}
|
386
409
|
try:
|
387
410
|
pendingsettings = fishclient._do_web_request(
|
@@ -418,10 +441,19 @@ class OEMHandler(object):
|
|
418
441
|
rawsettings = fishclient._do_web_request(fishclient._biosurl,
|
419
442
|
cache=False)
|
420
443
|
rawsettings = rawsettings.get('Attributes', {})
|
421
|
-
pendingsettings = fishclient._do_web_request(
|
444
|
+
pendingsettings = fishclient._do_web_request(
|
445
|
+
fishclient._setbiosurl)
|
446
|
+
return self._set_redfish_settings(
|
447
|
+
changeset, fishclient, currsettings, rawsettings,
|
448
|
+
pendingsettings, self.attrdeps, reginfo,
|
449
|
+
fishclient._setbiosurl)
|
450
|
+
|
451
|
+
def _set_redfish_settings(self, changeset, fishclient, currsettings,
|
452
|
+
rawsettings, pendingsettings, attrdeps, reginfo,
|
453
|
+
seturl):
|
422
454
|
etag = pendingsettings.get('@odata.etag', None)
|
423
455
|
pendingsettings = pendingsettings.get('Attributes', {})
|
424
|
-
dephandler = AttrDependencyHandler(
|
456
|
+
dephandler = AttrDependencyHandler(attrdeps, rawsettings,
|
425
457
|
pendingsettings)
|
426
458
|
for change in list(changeset):
|
427
459
|
if change not in currsettings:
|
@@ -440,7 +472,7 @@ class OEMHandler(object):
|
|
440
472
|
changeval = changeset[change]
|
441
473
|
overrides, blameattrs = dephandler.get_overrides(change)
|
442
474
|
meta = {}
|
443
|
-
for attr in
|
475
|
+
for attr in attrdeps['Attributes']:
|
444
476
|
if attr['AttributeName'] == change:
|
445
477
|
meta = dict(attr)
|
446
478
|
break
|
@@ -479,7 +511,7 @@ class OEMHandler(object):
|
|
479
511
|
changeset[change] = _to_boolean(changeset[change])
|
480
512
|
redfishsettings = {'Attributes': changeset}
|
481
513
|
fishclient._do_web_request(
|
482
|
-
|
514
|
+
seturl, redfishsettings, 'PATCH', etag=etag)
|
483
515
|
|
484
516
|
def attach_remote_media(self, url, username, password, vmurls):
|
485
517
|
return None
|
@@ -487,10 +519,10 @@ class OEMHandler(object):
|
|
487
519
|
def detach_remote_media(self):
|
488
520
|
return None
|
489
521
|
|
490
|
-
def get_description(self):
|
522
|
+
def get_description(self, fishclient):
|
491
523
|
return {}
|
492
524
|
|
493
|
-
def get_firmware_inventory(self, components):
|
525
|
+
def get_firmware_inventory(self, components, fishclient):
|
494
526
|
return []
|
495
527
|
|
496
528
|
def set_credentials(self, username, password):
|
@@ -15,15 +15,28 @@
|
|
15
15
|
import pyghmi.redfish.oem.generic as generic
|
16
16
|
from pyghmi.redfish.oem.lenovo import tsma
|
17
17
|
from pyghmi.redfish.oem.lenovo import xcc
|
18
|
+
from pyghmi.redfish.oem.lenovo import xcc3
|
18
19
|
|
19
20
|
|
20
21
|
def get_handler(sysinfo, sysurl, webclient, cache, cmd):
|
21
22
|
leninf = sysinfo.get('Oem', {}).get('Lenovo', {})
|
23
|
+
mgrinfo = {}
|
24
|
+
if leninf:
|
25
|
+
mgrinf, status = webclient.grab_json_response_with_status('/redfish/v1/Managers/1')
|
26
|
+
if status != 200:
|
27
|
+
mgrinfo = {}
|
22
28
|
if not leninf:
|
23
29
|
bmcinfo = cmd.bmcinfo
|
24
30
|
if 'Ami' in bmcinfo.get('Oem', {}):
|
25
31
|
return tsma.TsmHandler(sysinfo, sysurl, webclient, cache)
|
26
|
-
|
32
|
+
elif 'xclarity controller' in mgrinf.get('Model', '').lower():
|
33
|
+
if mgrinf['Model'].endswith('3'):
|
34
|
+
return xcc3.OEMHandler(sysinfo, sysurl, webclient, cache,
|
35
|
+
gpool=cmd._gpool)
|
36
|
+
else:
|
37
|
+
return xcc.OEMHandler(sysinfo, sysurl, webclient, cache,
|
38
|
+
gpool=cmd._gpool)
|
39
|
+
elif 'FrontPanelUSB' in leninf or 'USBManagementPortAssignment' in leninf or sysinfo.get('SKU', '').startswith('7X58'):
|
27
40
|
return xcc.OEMHandler(sysinfo, sysurl, webclient, cache,
|
28
41
|
gpool=cmd._gpool)
|
29
42
|
else:
|
@@ -579,7 +579,7 @@ class OEMHandler(generic.OEMHandler):
|
|
579
579
|
summary['badreadings'] = fallbackdata
|
580
580
|
return summary
|
581
581
|
|
582
|
-
def get_description(self):
|
582
|
+
def get_description(self, fishclient):
|
583
583
|
description = self._do_web_request('/DeviceDescription.json')
|
584
584
|
if description:
|
585
585
|
description = description[0]
|
@@ -674,7 +674,7 @@ class OEMHandler(generic.OEMHandler):
|
|
674
674
|
for diskent in adp.get('aimDisks', ()):
|
675
675
|
yield self._get_disk_firmware_single(diskent)
|
676
676
|
|
677
|
-
def get_firmware_inventory(self, components):
|
677
|
+
def get_firmware_inventory(self, components, fishclient):
|
678
678
|
sysinf = self.wc.grab_json_response('/api/dataset/sys_info')
|
679
679
|
for item in sysinf.get('items', {}):
|
680
680
|
for firm in item.get('firmware', []):
|
@@ -0,0 +1,137 @@
|
|
1
|
+
import pyghmi.redfish.oem.generic as generic
|
2
|
+
import pyghmi.exceptions as pygexc
|
3
|
+
|
4
|
+
|
5
|
+
class OEMHandler(generic.OEMHandler):
|
6
|
+
|
7
|
+
def get_description(self, fishclient):
|
8
|
+
bmcstgs = fishclient._do_web_request('/redfish/v1/Managers/1/Oem/Lenovo/BMCSettings')
|
9
|
+
heightu = bmcstgs.get('Attributes', {}).get('ServerConfigHeightU')
|
10
|
+
return {'height': heightu}
|
11
|
+
|
12
|
+
|
13
|
+
def get_system_configuration(self, hideadvanced=True, fishclient=None):
|
14
|
+
stgs = self._getsyscfg(fishclient)[0]
|
15
|
+
outstgs = {}
|
16
|
+
for stg in stgs:
|
17
|
+
outstgs[f'UEFI.{stg}'] = stgs[stg]
|
18
|
+
return outstgs
|
19
|
+
|
20
|
+
def set_system_configuration(self, changeset, fishclient):
|
21
|
+
bmchangeset = {}
|
22
|
+
vpdchangeset = {}
|
23
|
+
for stg in list(changeset):
|
24
|
+
if stg.startswith('BMC.'):
|
25
|
+
bmchangeset[stg.replace('BMC.', '')] = changeset[stg]
|
26
|
+
del changeset[stg]
|
27
|
+
if stg.startswith('UEFI.'):
|
28
|
+
changeset[stg.replace('UEFI.' '')] = changeset[stg]
|
29
|
+
del changeset[stg]
|
30
|
+
if stg.startswith('VPD.'):
|
31
|
+
vpdchangeset[stg.replace('VPD.', '')] = changeset[stg]
|
32
|
+
del changeset[stg]
|
33
|
+
if changeset:
|
34
|
+
super().set_system_configuration(changeset, fishclient)
|
35
|
+
if bmchangeset:
|
36
|
+
self._set_xcc3_settings(bmchangeset, fishclient)
|
37
|
+
if vpdchangeset:
|
38
|
+
self._set_xcc3_vpd(vpdchangeset, fishclient)
|
39
|
+
|
40
|
+
def _set_xcc3_vpd(self, changeset, fishclient):
|
41
|
+
newvpd = {'Attributes': changeset}
|
42
|
+
fishclient._do_web_request(
|
43
|
+
'/redfish/v1/Chassis/1/Oem/Lenovo/SysvpdSettings/Actions/LenovoSysVpdSettings.SetVpdSettings',
|
44
|
+
newvpd)
|
45
|
+
|
46
|
+
|
47
|
+
def _set_xcc3_settings(self, changeset, fishclient):
|
48
|
+
currsettings, reginfo = self._get_lnv_bmcstgs(fishclient)
|
49
|
+
rawsettings = fishclient._do_web_request('/redfish/v1/Managers/1/Oem/Lenovo/BMCSettings',
|
50
|
+
cache=False)
|
51
|
+
rawsettings = rawsettings.get('Attributes', {})
|
52
|
+
pendingsettings = {}
|
53
|
+
ret = self._set_redfish_settings(
|
54
|
+
changeset, fishclient, currsettings, rawsettings,
|
55
|
+
pendingsettings, self.lenovobmcattrdeps, reginfo,
|
56
|
+
'/redfish/v1/Managers/1/Oem/Lenovo/BMCSettings')
|
57
|
+
fishclient._do_web_request('/redfish/v1/Managers/1/Oem/Lenovo/BMCSettings', cache=False)
|
58
|
+
return ret
|
59
|
+
|
60
|
+
def get_extended_bmc_configuration(self, fishclient, hideadvanced=True):
|
61
|
+
cfgin = self._get_lnv_bmcstgs(fishclient)[0]
|
62
|
+
cfgout = {}
|
63
|
+
for stgname in cfgin:
|
64
|
+
cfgout[f'BMC.{stgname}'] = cfgin[stgname]
|
65
|
+
vpdin = self._get_lnv_vpd(fishclient)[0]
|
66
|
+
for stgname in vpdin:
|
67
|
+
cfgout[f'VPD.{stgname}'] = vpdin[stgname]
|
68
|
+
return cfgout
|
69
|
+
|
70
|
+
def _get_lnv_vpd(self, fishclient):
|
71
|
+
currsettings, reginfo = self._get_lnv_stgs(
|
72
|
+
fishclient, '/redfish/v1/Chassis/1/Oem/Lenovo/SysvpdSettings')
|
73
|
+
self.lenovobmcattrdeps = reginfo[3]
|
74
|
+
return currsettings, reginfo
|
75
|
+
|
76
|
+
def _get_lnv_bmcstgs(self, fishclient):
|
77
|
+
currsettings, reginfo = self._get_lnv_stgs(
|
78
|
+
fishclient, '/redfish/v1/Managers/1/Oem/Lenovo/BMCSettings')
|
79
|
+
self.lenovobmcattrdeps = reginfo[3]
|
80
|
+
return currsettings, reginfo
|
81
|
+
|
82
|
+
def _get_lnv_stgs(self, fishclient, url):
|
83
|
+
bmcstgs = fishclient._do_web_request(url)
|
84
|
+
bmcreg = bmcstgs.get('AttributeRegistry', None)
|
85
|
+
extrainfo = {}
|
86
|
+
valtodisplay = {}
|
87
|
+
currsettings = {}
|
88
|
+
reginfo = {}, {}, {}, {}
|
89
|
+
if bmcreg:
|
90
|
+
reginfo = self._get_attrib_registry(fishclient, bmcreg)
|
91
|
+
if reginfo:
|
92
|
+
extrainfo, valtodisplay, _, _ = reginfo
|
93
|
+
for setting in bmcstgs.get('Attributes', {}):
|
94
|
+
val = bmcstgs['Attributes'][setting]
|
95
|
+
currval = val
|
96
|
+
val = valtodisplay.get(setting, {}).get(val, val)
|
97
|
+
val = {'value': val}
|
98
|
+
val.update(**extrainfo.get(setting, {}))
|
99
|
+
currsettings[setting] = val
|
100
|
+
return currsettings, reginfo
|
101
|
+
|
102
|
+
def get_firmware_inventory(self, components, fishclient):
|
103
|
+
fwlist = fishclient._do_web_request(fishclient._fwinventory)
|
104
|
+
rawfwurls = [x['@odata.id'] for x in fwlist.get('Members', [])]
|
105
|
+
fwurls = []
|
106
|
+
for fwurl in rawfwurls:
|
107
|
+
if fwurl.startswith('/redfish/v1/UpdateService/FirmwareInventory/Bundle.'):
|
108
|
+
continue # skip Bundle information for now
|
109
|
+
fwurls.append(fwurl)
|
110
|
+
self._fwnamemap = {}
|
111
|
+
for res in fishclient._do_bulk_requests(fwurls):
|
112
|
+
redres = res[0]
|
113
|
+
if redres.get('Name', '').startswith('Firmware:'):
|
114
|
+
redres['Name'] = redres['Name'].replace('Firmware:', '')
|
115
|
+
if redres['Name'].startswith('Firmware-PSoC') and 'Drive_Backplane' in redres["@odata.id"]:
|
116
|
+
redres['Name'] = 'Drive Backplane'
|
117
|
+
if redres['Name'].startswith('DEVICE-'):
|
118
|
+
redres['Name'] = redres['Name'].replace('DEVICE-', '')
|
119
|
+
if redres['Name'].startswith('POWER-PSU'):
|
120
|
+
redres['Name'] = redres['Name'].replace('POWER-', '')
|
121
|
+
swid = redres.get('SoftwareId', '')
|
122
|
+
buildid = ''
|
123
|
+
version = redres.get('Version', None)
|
124
|
+
if swid.startswith('FPGA-') or swid.startswith('UEFI-') or swid.startswith('BMC-'):
|
125
|
+
buildid = swid.split('-')[1] + version.split('-')[0]
|
126
|
+
version = '-'.join(version.split('-')[1:])
|
127
|
+
if version:
|
128
|
+
redres['Version'] = version
|
129
|
+
cres = fishclient._extract_fwinfo(res)
|
130
|
+
if cres[0] is None:
|
131
|
+
continue
|
132
|
+
if buildid:
|
133
|
+
cres[1]['build'] = buildid
|
134
|
+
yield cres
|
135
|
+
raise pygexc.BypassGenericBehavior()
|
136
|
+
|
137
|
+
|
@@ -92,6 +92,7 @@ pyghmi/redfish/oem/lenovo/__init__.py
|
|
92
92
|
pyghmi/redfish/oem/lenovo/main.py
|
93
93
|
pyghmi/redfish/oem/lenovo/tsma.py
|
94
94
|
pyghmi/redfish/oem/lenovo/xcc.py
|
95
|
+
pyghmi/redfish/oem/lenovo/xcc3.py
|
95
96
|
pyghmi/tests/__init__.py
|
96
97
|
pyghmi/tests/unit/__init__.py
|
97
98
|
pyghmi/tests/unit/base.py
|
@@ -0,0 +1 @@
|
|
1
|
+
{"git_version": "b6776ce", "is_release": true}
|
pyghmi-1.5.71/makesetup
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
cd `dirname $0`
|
3
|
-
VERSION=`git describe|cut -d- -f 1`
|
4
|
-
NUMCOMMITS=`git describe|cut -d- -f 2`
|
5
|
-
if [ "$NUMCOMMITS" != "$VERSION" ]; then
|
6
|
-
VERSION=$VERSION.dev$NUMCOMMITS+g`git describe|cut -d- -f 3`
|
7
|
-
fi
|
8
|
-
echo $VERSION > VERSION
|
9
|
-
sed -e "s/#VERSION#/$VERSION/" setup.py.tmpl > setup.py
|
10
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
{"git_version": "a8a0363", "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
|
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
|