Skip to content

Commit 5966b26

Browse files
author
Jack Garcia
committed
updatec to latest 2.0 version
1 parent 5266d98 commit 5966b26

File tree

11 files changed

+68
-10
lines changed

11 files changed

+68
-10
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ History
137137
* 12/06/2016: Release of v1.6.0
138138
* 01/17/2017: Release of v1.7.0
139139
* 02/01/2017: Release of v1.8.0
140+
* 03/22/2017: Release of v1.9.0
141+
* 04/12/2017: Release of v1.9.1
140142
141143
Copyright and License
142144
---------------------

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 1.9.2).
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).
107107

108108
::
109109

110110
python setup.py sdist --formats=zip
111111
cd dist
112-
pip install --upgrade python-ilorest-library-1.9.2.zip
112+
pip install --upgrade python-ilorest-library-2.0.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'1.9.2'
57+
version = u'2.0.0'
5858
# The full version, including alpha/beta/rc tags.
59-
release = u'1.9.2'
59+
release = u'2.0.0'
6060

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

makeandinstallzip.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
python setup.py sdist --formats=zip
22
cd dist
3-
pip install --upgrade python-ilorest-library-1.9.2.zip
3+
pip install --upgrade python-ilorest-library-2.0.0.zip

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ requires = jsonpatch >= 1.3
77
jsonpointer >= 1.1
88
urlparse2 >= 1.1.1
99
validictory >= 1.0.1
10-
ilorest_chif >= 1.9.2
10+
ilorest_chif >= 2.0.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22

33
setup(name='python-ilorest-library',
4-
version='1.9.2',
4+
version='2.0.0',
55
description='iLO Rest Python Library',
66
author = 'Hewlett Packard Enterprise',
77
author_email = 'jackgarcia77@gmail.com',

src/redfish/hpilo/risblobstore2.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ class Blob2ListError(Exception):
7979
"""Raised when list operation fails"""
8080
pass
8181

82+
class Blob2SecurityError(Exception):
83+
"""Raised when list operation fails"""
84+
pass
85+
8286
class BlobNotFoundError(Exception):
8387
"""Raised when blob not found in key/namespace"""
8488
pass
@@ -87,6 +91,10 @@ class ChifDllMissingError(Exception):
8791
"""Raised when unable to obtain ilorest_chif dll handle"""
8892
pass
8993

94+
class EncryptionEnabledError(Exception):
95+
"""Raised when high security encryption is enabled"""
96+
pass
97+
9098
#----------------------------------------------------------
9199

92100
#-------------------Helper functions-------------------------
@@ -152,6 +160,43 @@ def create(self, key, namespace):
152160

153161
return resp
154162

163+
def createbc(self, key, namespace):
164+
"""Create the blob
165+
166+
:param key: The blob key to create.
167+
:type key: str.
168+
:param namespace: The blob namespace to create the key in.
169+
:type namespace: str.
170+
171+
"""
172+
lib = self.gethprestchifhandle()
173+
lib.create_not_blobentrybc.argtypes = [c_char_p, c_char_p]
174+
lib.create_not_blobentrybc.restype = POINTER(c_ubyte)
175+
176+
name = create_string_buffer(key)
177+
namespace = create_string_buffer(namespace)
178+
179+
ptr = lib.create_not_blobentrybc(name, namespace)
180+
data = ptr[:lib.size_of_srbuf()]
181+
data = bytearray(data)
182+
183+
resp = self._send_receive_raw(data, lib.size_of_srbuf())
184+
185+
if len(resp) > lib.size_of_srbuf():
186+
raise Blob2CreateError("create response larger than expected")
187+
188+
if len(resp) < lib.size_of_srbuf():
189+
raise Blob2CreateError("create response smaller than expected")
190+
191+
errorcode = struct.unpack("<I", bytes(resp[8:12]))[0]
192+
if not (errorcode == BlobReturnCodes.SUCCESS or \
193+
errorcode == BlobReturnCodes.NOTMODIFIED):
194+
raise HpIloError(errorcode)
195+
196+
self.unloadchifhandle(lib)
197+
198+
return resp
199+
155200
def get_info(self, key, namespace):
156201
"""Get information for a particular blob
157202

src/redfish/hpilo/rishpilo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def __init__(self):
101101
if status == BlobReturnCodes.CHIFERR_NoDriver:
102102
errmsg = "chif"
103103
elif status == BlobReturnCodes.CHIFERR_AccessDenied:
104-
errmsg = "You must be root/Administrator to use this program."
104+
errmsg = "You must be root/Administrator to use this program."
105105
raise HpIloInitialError(errmsg)
106106

107107
self.dll.ChifSetRecvTimeout(self.fhandle, 30000)

src/redfish/rest/v1.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,20 @@
3333
import ctypes
3434
import hashlib
3535
import logging
36+
import httplib
3637
import platform
3738
try:
3839
import io
3940
except ImportError:
4041
pass
4142

43+
from StringIO import StringIO
4244
from collections import (OrderedDict)
4345

4446
import urlparse2 #pylint warning disable
4547

4648
from redfish.hpilo.rishpilo import HpIloChifPacketExchangeError
47-
from redfish.hpilo.risblobstore2 import BlobStore2, Blob2OverrideError
49+
from redfish.hpilo.risblobstore2 import BlobStore2, Blob2OverrideError, ChifDllMissingError
4850

4951
#---------End of imports---------
5052

@@ -79,6 +81,10 @@ class JsonDecodingError(Exception):
7981
"""Raised when there is an error in json data."""
8082
pass
8183

84+
class SecurityStateError(Exception):
85+
"""Raised when there is a strict security state."""
86+
pass
87+
8288
class RisObject(dict):
8389
"""Converts a JSON/Rest dict into a object so you can use .property
8490
notation"""
@@ -1419,7 +1425,7 @@ def get_client_instance(base_url=None, username=None, password=None, \
14191425
if platform.system() == 'Windows':
14201426
if not ctypes.windll.kernel32.LoadLibraryA('ilorest_chif'):
14211427
if not ctypes.windll.kernel32.LoadLibraryA('hprest_chif'):
1422-
raise ChifDriverMissingOrNotFound()
1428+
raise ChifDllMissingError()
14231429
else:
14241430
if not os.path.isdir('/dev/hpilo'):
14251431
raise ChifDriverMissingOrNotFound()

src/redfish/ris/rmc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,7 @@ def merge_dict(self, currdict, newdict):
18421842

18431843
def get_error_messages(self):
18441844
"""Handler of error messages from iLO"""
1845+
LOGGER.info("Entering validation...")
18451846
errmessages = {}
18461847
reglist = []
18471848
iloversion = self.getiloversion()

0 commit comments

Comments
 (0)