Skip to content

Commit

Permalink
Merge pull request #181 from dell/GitHub_issue_180
Browse files Browse the repository at this point in the history
GitHub issue 180
  • Loading branch information
rawstorage authored Apr 9, 2024
2 parents 1ba0ff3 + 9d58071 commit cff81ae
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 17 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
PyU4V Change Log
================

Version 10.1.0.2 and backport to Version 10.0.0.20
====================================
added timeout parameter to connection to make configurable. PyU4V.conf also
can take new setup value for timeout to override 120s value.

Version 10.1.0.1
====================================
Bug fix for Github Issue #174 restart_unisphere_application has wrong payload.
Expand Down
3 changes: 2 additions & 1 deletion PyU4V.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ array=00012345678
; remote_array=00012345679
; verify=True
verify=/path-to-file/server_hostname.pem

;overrides default timeout on REST calls for specificed value in seconds
;timeout=500
; log configuration
[loggers]
keys=root,PyU4V
Expand Down
2 changes: 1 addition & 1 deletion PyU4V/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .univmax_conn import U4VConn # noqa: F401

__title__ = 'pyu4v'
__version__ = '10.1.0.1'
__version__ = '10.1.0.2'
__author__ = 'Dell EMC or its subsidiaries'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2021 Dell EMC Inc'
6 changes: 4 additions & 2 deletions PyU4V/rest_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class RestRequests(object):
"""RestRequests."""

def __init__(self, username, password, verify, base_url, interval, retries,
application_type=None, proxies=None):
application_type=None, proxies=None, timeout=None):
"""__init__."""
self.username = username
self.password = password
Expand All @@ -61,7 +61,9 @@ def __init__(self, username, password, verify, base_url, interval, retries,
ACCEPT: APP_JSON,
USER_AGENT: ua_details,
APP_TYPE: application_type}
self.timeout = 120
# if timeout is not none set self.timeout to timeout
# value or set to 120
self.timeout = timeout or 120
self.interval = interval
self.proxies = proxies
self.retries = retries
Expand Down
10 changes: 6 additions & 4 deletions PyU4V/univmax_conn.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ def __init__(self, username=None, password=None, server_ip=None,
u4v_version=constants.UNISPHERE_VERSION,
interval=5, retries=200, array_id=None,
application_type=app_type, remote_array=None,
remote_array_2=None, proxies=None):
remote_array_2=None, proxies=None, timeout=None):
"""__init__."""
config = config_handler.set_logger_and_config(file_path)
self.end_date = int(round(time.time() * 1000))
self.start_date = (self.end_date - 3600000)
self.array_id = array_id
self.timeout = timeout if timeout is not None else 120
# Set array ID
if not self.array_id:
try:
Expand Down Expand Up @@ -96,6 +97,8 @@ def __init__(self, username=None, password=None, server_ip=None,
self.remote_array_2 = config.get(SETUP, R_ARRAY_2)
else:
self.remote_array_2 = None
if config.has_option(SETUP, 'timeout') and timeout is None:
self.timeout = int(config.get(SETUP, 'timeout'))

# Set verification
if verify is None:
Expand All @@ -112,13 +115,12 @@ def __init__(self, username=None, password=None, server_ip=None,
# Initialise REST session
base_url = f'https://{server_ip}:{port}/univmax/restapi'
enhanced_api_url = f'https://{server_ip}:{port}/univmax/rest'

self.rest_client = RestRequests(
username, password, verify, base_url, interval, retries,
application_type, proxies=proxies)
application_type, proxies=proxies, timeout=self.timeout)
self.enhanced_rest_client = RestRequests(
username, password, verify, enhanced_api_url, interval, retries,
application_type, proxies=proxies)
application_type, proxies=proxies, timeout=self.timeout)
self.request = self.rest_client.rest_request
self.common = CommonFunctions(self.rest_client)
self.validate_unisphere()
Expand Down
2 changes: 1 addition & 1 deletion PyU4V/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
APP_MPART = 'multipart/form-data'

# Unisphere REST URI constants
PYU4V_VERSION = '10.1.0.1'
PYU4V_VERSION = '10.1.0.2'
UNISPHERE_VERSION = '101'
ENHANCED_API_VERSION = 'v1'
UCODE_6079 = '6079'
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PyU4V Version 10.1
+-------------------------------+----------------------------+
| **Author** | Dell EMC |
+-------------------------------+----------------------------+
| **PyU4V Version** | 10.1.0.1 |
| **PyU4V Version** | 10.1.0.2 |
+-------------------------------+----------------------------+
| **Minimum Unisphere Version** | 10.1.0.0 |
+-------------------------------+----------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version.
version = u'10.1'
# The full version, including alpha/beta/rc tags
release = '10.1.0.1'
release = '10.1.0.2'

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Supported PyU4V Versions
------------------------

+-------------------------------+----------------------------------------+
| **PyU4V Version** | 10.1.0.1 |
| **PyU4V Version** | 10.1.0.2 |
+-------------------------------+----------------------------------------+
| **Minimum Unisphere Version** | 10.1 |
+-------------------------------+----------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Requirements
------------

+-------------------------------+----------------------------------------+
| **PyU4V Version** | 10.1.0.1 |
| **PyU4V Version** | 10.1.0.2 |
+-------------------------------+----------------------------------------+
| **Minimum Unisphere Version** | 10.1 |
+-------------------------------+----------------------------------------+
Expand Down
6 changes: 3 additions & 3 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Supported PyU4V Versions
------------------------

+-------------------------------+----------------------------------------+
| **PyU4V Version** | 10.0.0.19 |
| **PyU4V Version** | 10.1.0.2 |
+-------------------------------+----------------------------------------+
| **Minimum Unisphere Version** | 10.0 |
| **Minimum Unisphere Version** | 10.1 |
+-------------------------------+----------------------------------------+
| **Array Model** | VMAX-3, VMAX AFA, PowerMax |
+-------------------------------+----------------------------------------+
Expand Down Expand Up @@ -123,7 +123,7 @@ PyU4V docs offline.
Disclaimer
----------

PyU4V 9.2 is distributed under the Apache 2.0 License. Unless required by
PyU4V 10.1 is distributed under the Apache 2.0 License. Unless required by
applicable law or agreed to in writing, software distributed under the Apache
2.0 License is distributed on an **"as is" basis, without warranties or**
**conditions of any kind**, either express or implied. See the License for the
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setuptools.setup(
name='PyU4V',
version='10.1.0.1',
version='10.1.0.2',
url='https://github.com/dell/PyU4V/',
author='Dell Inc. or its subsidiaries',
author_email='helen.walsh@dell.com',
Expand Down

0 comments on commit cff81ae

Please sign in to comment.