Skip to content

Commit abbc6ad

Browse files
committed
updating to version 2.1
1 parent e6b9783 commit abbc6ad

File tree

73 files changed

+1286
-1115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1286
-1115
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ History
139139
* 02/01/2017: Release of v1.8.0
140140
* 03/22/2017: Release of v1.9.0
141141
* 04/12/2017: Release of v1.9.1
142+
* 07/17/2017: Release of v2.0.0
143+
* 10/30/2017: Release of v2.1.0
142144
143145
Copyright and License
144146
---------------------

docs/Installation-Guide.rest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ Execute the following command from the directory where you want to copy the sour
103103
Building and installing HP REST library
104104
===================================
105105

106-
First download the redfish.zip file from the github. Next unzip redfish.zip file to redfish directory and from the command prompt go to the directory. Execute the following commands in order to install redfish (assuming the version is 2.0.0).
106+
First download the redfish.zip file from the github. Next unzip redfish.zip file to redfish directory and from the command prompt go to the directory. Execute the following commands in order to install redfish (assuming the version is 2.1.0).
107107

108108
::
109109

110110
python setup.py sdist --formats=zip
111111
cd dist
112-
pip install --upgrade python-ilorest-library-2.0.0.zip
112+
pip install --upgrade python-ilorest-library-2.1.0.zip
113113

114114
::
115115

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
# built documents.
5555
#
5656
# The short X.Y version.
57-
version = u'2.0.0'
57+
version = u'2.1.0'
5858
# The full version, including alpha/beta/rc tags.
59-
release = u'2.0.0'
59+
release = u'2.1.0'
6060

6161
# The language for content autogenerated by Sphinx. Refer to documentation
6262
# for a list of supported languages.

examples/Redfish/_redfishobject.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ def __init__(self, host, login_account, login_password):
9595
self.SYSTEMS_RESOURCES = self.ex1_get_resource_directory()
9696
self.MESSAGE_REGISTRIES = self.ex2_get_base_registry()
9797

98-
def __del__(self):
98+
def delete_obj(self):
9999
try:
100100
self.redfish_client.logout()
101-
except AttributeError, excp:
101+
except AttributeError as excp:
102102
pass
103103

104104
def search_for_type(self, type):

examples/Redfish/ex01_get_resource_directory.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ def ex1_get_resource_directory(redfishobj):
5555
# Create a REDFISH object
5656
try:
5757
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
58-
except ServerDownOrUnreachableError, excp:
58+
except ServerDownOrUnreachableError as excp:
5959
sys.stderr.write("ERROR: server not reachable or doesn't support " \
6060
"RedFish.\n")
6161
sys.exit()
62-
except Exception, excp:
62+
except Exception as excp:
6363
raise excp
6464

6565
ex1_get_resource_directory(REDFISH_OBJ)
66+
REDFISH_OBJ.redfish_client.logout()
67+

examples/Redfish/ex02_get_base_registry.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,13 @@ def ex2_get_base_registry(redfishobj):
6565
# Create a REDFISH object
6666
try:
6767
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
68-
except ServerDownOrUnreachableError, excp:
68+
except ServerDownOrUnreachableError as excp:
6969
sys.stderr.write("ERROR: server not reachable or doesn't support " \
7070
"RedFish.\n")
7171
sys.exit()
72-
except Exception, excp:
72+
except Exception as excp:
7373
raise excp
7474

7575
ex2_get_base_registry(REDFISH_OBJ)
76+
REDFISH_OBJ.redfish_client.logout()
7677

examples/Redfish/ex03_change_bios_setting.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ def ex3_change_bios_setting(redfishobj, bios_property, property_value, \
2626
" with the 2.50 firmware or earlier. \n")
2727

2828
for instance in instances:
29-
body = {"Attributes":{bios_property: property_value}}
29+
if redfishobj.typepath.defs.isgen9:
30+
body = {bios_property: property_value}
31+
else:
32+
body = {"Attributes": {bios_property: property_value}}
33+
3034
response = redfishobj.redfish_patch(instance["@odata.id"], body, \
3135
optionalpassword=bios_password)
3236
redfishobj.error_handler(response)
@@ -49,11 +53,13 @@ def ex3_change_bios_setting(redfishobj, bios_property, property_value, \
4953
# Create a REDFISH object
5054
try:
5155
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
52-
except ServerDownOrUnreachableError, excp:
56+
except ServerDownOrUnreachableError as excp:
5357
sys.stderr.write("ERROR: server not reachable or doesn't support " \
5458
"RedFish.\n")
5559
sys.exit()
56-
except Exception, excp:
60+
except Exception as excp:
5761
raise excp
5862

5963
ex3_change_bios_setting(REDFISH_OBJ, "AdminName", "New Name")
64+
REDFISH_OBJ.redfish_client.logout()
65+

examples/Redfish/ex04_reset_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ def ex4_reset_server(redfishobj, bios_password=None):
6161
# Create a REDFISH object
6262
try:
6363
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
64-
except ServerDownOrUnreachableError, excp:
64+
except ServerDownOrUnreachableError as excp:
6565
sys.stderr.write("ERROR: server not reachable or doesn't support " \
6666
"RedFish.\n")
6767
sys.exit()
68-
except Exception, excp:
68+
except Exception as excp:
6969
raise excp
7070

7171
ex4_reset_server(REDFISH_OBJ)
72+
REDFISH_OBJ.redfish_client.logout()
7273

examples/Redfish/ex05_enable_secure_boot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ def ex5_enable_secure_boot(redfishobj, secure_boot_enable, bios_password=None):
4444
# Create a REDFISH object
4545
try:
4646
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
47-
except ServerDownOrUnreachableError, excp:
47+
except ServerDownOrUnreachableError as excp:
4848
sys.stderr.write("ERROR: server not reachable or doesn't support " \
4949
"RedFish.\n")
5050
sys.exit()
51-
except Exception, excp:
51+
except Exception as excp:
5252
raise excp
5353

5454
ex5_enable_secure_boot(REDFISH_OBJ, False)
55+
REDFISH_OBJ.redfish_client.logout()
5556

examples/Redfish/ex06_bios_revert_default.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,13 @@ def ex6_bios_revert_default(redfishobj):
4747
# Create a REDFISH object
4848
try:
4949
REDFISH_OBJ = RedfishObject(iLO_https_url, iLO_account, iLO_password)
50-
except ServerDownOrUnreachableError, excp:
50+
except ServerDownOrUnreachableError as excp:
5151
sys.stderr.write("ERROR: server not reachable or doesn't support " \
5252
"RedFish.\n")
5353
sys.exit()
54-
except Exception, excp:
54+
except Exception as excp:
5555
raise excp
5656

5757
ex6_bios_revert_default(REDFISH_OBJ)
58+
REDFISH_OBJ.redfish_client.logout()
5859

0 commit comments

Comments
 (0)