diff --git a/docs/api/hpelefthandclient/http.rst b/docs/api/hpelefthandclient/http.rst index 71754f5..7bbb0d4 100644 --- a/docs/api/hpelefthandclient/http.rst +++ b/docs/api/hpelefthandclient/http.rst @@ -4,7 +4,8 @@ .. automodule:: hpelefthandclient.http :synopsis: HTTP REST Base Class - .. autoclass:: hpelefthandclient.http.HTTPJSONRESTClient(api_url, [secure=True[,http_log_debug=False]]) + .. autoclass:: hpelefthandclient.http.HTTPJSONRESTClient(api_url, secure=True, http_log_debug=False, + suppress_ssl_warnings=False) .. automethod:: authenticate .. automethod:: unauthenticate diff --git a/docs/changelog.rst b/docs/changelog.rst index 3bba548..cdede51 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -87,3 +87,8 @@ Changes in Version 2.0.0 * Rebranded the HPLeftHandClient to HPELeftHandClient. * Updating the documentation to use the new PyPi project name for the client, 'python-lefthandclient'. + +Changes in Version 2.0.1 +------------------------ + +* Allows suppressing of InsecureRequestWarning messages diff --git a/docs/tutorial.rst b/docs/tutorial.rst index d50dbb1..5427bd9 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -34,12 +34,12 @@ Doing so is easy: # SSL certification verification is defaulted to False. In order to # override this, set secure=True. or secure='/path/to/cert.crt' # cl = client.HPELeftHandClient("https://10.10.10.10:8081/lhos", - # secure=True) + # secure=True) # Or, to use ca certificates as documented by Python Requests, # pass in the ca-certificates.crt file # http://docs.python-requests.org/en/v1.0.4/user/advanced # cl = client.HPELeftHandClient("https://10.10.10.10:8081/lhos", - # secure='/etc/ssl/certs/ca-certificates.crt') + # secure='/etc/ssl/certs/ca-certificates.crt') try: cl.login(username, password) diff --git a/hpelefthandclient/__init__.py b/hpelefthandclient/__init__.py index fda3601..bdf8a40 100644 --- a/hpelefthandclient/__init__.py +++ b/hpelefthandclient/__init__.py @@ -24,7 +24,7 @@ HPE LeftHand REST Client """ -version_tuple = (2, 0, 0) +version_tuple = (2, 0, 1) def get_version_string(): diff --git a/hpelefthandclient/http.py b/hpelefthandclient/http.py index e52a76b..402cb2e 100644 --- a/hpelefthandclient/http.py +++ b/hpelefthandclient/http.py @@ -50,6 +50,9 @@ class HTTPJSONRESTClient(object): :type secure: bool :param http_log_debug: Turns on http log debugging. Default will not log :type http_log_debug: bool + :param suppress_ssl_warnings: Suppresses log warning messages if True. + Default will not suppress warnings. + :type suppress_ssl_warnings: bool """ @@ -60,7 +63,10 @@ class HTTPJSONRESTClient(object): http_log_debug = False _logger = logging.getLogger(__name__) - def __init__(self, api_url, secure=False, http_log_debug=False): + def __init__(self, api_url, secure=False, http_log_debug=False, + suppress_ssl_warnings=False): + if suppress_ssl_warnings: + requests.packages.urllib3.disable_warnings() self.session_key = None #should be http:///lhos