Skip to content

Commit 8cf8396

Browse files
committed
2 parents 1dd04e4 + 1de1a8e commit 8cf8396

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ It must be placed in your working environment path.
8484

8585
Usage
8686
----------
87-
For 3.x and greater versions of the library see the documentation for usage: https://pages.github.hpe.com/intelligent-provisioning/python-redfish-library/
87+
For 3.x and greater versions of the library see the documentation for usage: https://hewlettpackard.github.io/python-ilorest-library/
8888

89-
For 2.x versions of the library documentation is located at the `Wiki <https://github.hpe.com/intelligent-provisioning/python-redfish-library/wiki>`_.
89+
For 2.x versions of the library documentation is located at the `Wiki <https://github.com/HewlettPackard/python-ilorest-library/wiki>`_.
9090

9191
Contributing
9292
----------

examples/Redfish/set_ethernet_management_iface_static_ip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def set_ilo_static_ipv4(_redfishobj, ipv4_dict, dns_dict):
8888
resp = _redfishobj.patch(ethernet, {"DHCPv4": {"UseDNSServers": False}})
8989
ilo_response(_redfishobj, resp)
9090
if ethernet_data[ethernet]['DHCPv4'].get('UseGateway'):
91-
resp = _redfishobj.pathc(ethernet, {"DHCPv4": {"UseGateway": False}})
91+
resp = _redfishobj.patch(ethernet, {"DHCPv4": {"UseGateway": False}})
9292
ilo_response(_redfishobj, resp)
9393
if 'IPv4StaticAddresses' in ethernet_data[ethernet]:
9494
body.update({"IPv4Addresses": [ipv4_dict]})

examples/Redfish/set_license_key.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ def set_license_key(_redfishobj, ilo_key):
4040
else:
4141
#Use Resource directory to find the relevant URI
4242
for instance in resource_instances:
43-
if '#HpeiLOLicense.' in instance['@odata.type']:
44-
ilo_lic_uri = instance['@odata.id']
43+
if '#Manager.' in instance['@odata.type']:
44+
manager_uri = instance['@odata.id']
45+
mager_data = _redfishobj.get(manager_uri)
46+
ilo_lic_uri = mager_data.obj['Oem']['Hpe']['Links']['LicenseService']['@odata.id']
4547

4648
if ilo_lic_uri:
4749
ilo_license_collection = _redfishobj.get(ilo_lic_uri)

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ jsonpath_rw
33
jsonpointer
44
urllib3
55
six
6+
certifi

src/redfish/rest/containers.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,21 @@ class RisObject(dict):
7070
:param d: dictionary to be converted
7171
:type d: dict
7272
"""
73-
__getattr__ = dict.__getitem__
74-
7573
def __init__(self, d):
7674
"""Initialize RisObject
7775
"""
7876
super(RisObject, self).__init__()
7977
self.update(**dict((k, self.parse(value)) for k, value in list(d.items())))
8078

79+
def __getattr__(self, k):
80+
try:
81+
return self[k]
82+
except KeyError:
83+
raise AttributeError(
84+
"type object '%s' has no attribute '%s'" %
85+
(self.__class__.__name__, k)
86+
)
87+
8188
@classmethod
8289
def parse(cls, value):
8390
"""Parse for RIS value

0 commit comments

Comments
 (0)