Skip to content

Commit

Permalink
At 9.37
Browse files Browse the repository at this point in the history
  • Loading branch information
ABHISHEK-SINHA10 committed Jan 15, 2025
1 parent e6c739f commit bb77bfd
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 69 deletions.
16 changes: 15 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,18 @@ disable=
inconsistent-return-statements,
arguments-differ,
too-many-arguments,
too-many-positional-arguments
too-many-positional-arguments,
too-few-public-methods,
broad-exception-raised,
invalid-name,
assignment-from-no-return,
global-statement,
fixme,
assignment-from-none,
too-many-instance-attributes,
too-many-lines,
redefined-builtin,
super-with-arguments,
too-many-public-methods,
no-member,
too-many-return-statements
10 changes: 5 additions & 5 deletions PyPowerStore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,20 @@ def request(self, http_method, url, payload=None, querystring=None, all_pages=No
raise PowerStoreException(PowerStoreException.VALUE_ERROR, error_msg)
except SSLError as exception:
LOG.error(str(exception))
raise PowerStoreException(PowerStoreException.SSL_ERROR, str(exception))
raise PowerStoreException(PowerStoreException.SSL_ERROR, str(exception)) from exception
except ConnectionError as exception:
LOG.error(str(exception))
raise PowerStoreException(
PowerStoreException.CONNECTION_ERROR, str(exception)
PowerStoreException.CONNECTION_ERROR, str(exception) from exception
)
except TooManyRedirects as exception:
LOG.error(str(exception))
raise PowerStoreException(
PowerStoreException.TOO_MANY_REDIRECTS_ERROR, str(exception)
PowerStoreException.TOO_MANY_REDIRECTS_ERROR, str(exception) from exception
)
except Timeout as exception:
LOG.error(str(exception))
raise PowerStoreException(PowerStoreException.TIMEOUT_ERROR, str(exception))
raise PowerStoreException(PowerStoreException.TIMEOUT_ERROR, str(exception)) from exception
except socket.error as exception:
LOG.error(str(exception))
raise PowerStoreException(PowerStoreException.SOCKET_ERR, str(exception))
raise PowerStoreException(PowerStoreException.SOCKET_ERR, str(exception)) from exception
2 changes: 1 addition & 1 deletion PyPowerStore/tests/unit_tests/data/common_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ class CommonData:
"messages": [
{
"arguments": [
"[File system delete rejected due " "to existing snap(s).]"
"[File system delete rejected due to existing snap(s).]"
],
"code": "0xE08010080003",
"message_l10n": "Deletion of File System failed "
Expand Down
2 changes: 1 addition & 1 deletion PyPowerStore/tests/unit_tests/data/file_system_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class FileSystemData:
"messages": [
{
"arguments": [
"[File system delete rejected due " "to existing snap(s).]"
"[File system delete rejected due to existing snap(s).]"
],
"code": "0xE08010080003",
"message_l10n": "Deletion of File System failed "
Expand Down
21 changes: 2 additions & 19 deletions PyPowerStore/tests/unit_tests/mock_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import base64
import json

import PyPowerStore.tests.unit_tests.myrequests as myrequests
from PyPowerStore.tests.unit_tests import myrequests
from PyPowerStore.utils import constants

# from myrequests.exceptions import SSLError
Expand Down Expand Up @@ -232,23 +232,6 @@ def request(self, http_method, url, payload=None, querystring=None, all_pages=No
str(ex), http_method, url, payload, querystring
)
)
raise PowerStoreException(PowerStoreException.VALUE_ERROR, error_msg)
raise PowerStoreException(PowerStoreException.VALUE_ERROR, error_msg) from ex
except Exception:
raise
"""
except socket.error as exception:
raise PowerStoreException(PowerStoreException.SOCKET_ERR,
str(exception))
except SSLError as exception:
raise PowerStoreException(PowerStoreException.SSL_ERROR,
str(exception))
except ConnectionError as exception:
raise PowerStoreException(PowerStoreException.CONNECTION_ERROR,
str(exception))
except TooManyRedirects as exception:
raise PowerStoreException(
PowerStoreException.TOO_MANY_REDIRECTS_ERROR, str(exception))
except Timeout as exception:
raise PowerStoreException(PowerStoreException.TIMEOUT_ERROR,
str(exception))
"""
1 change: 1 addition & 0 deletions PyPowerStore/tests/unit_tests/myrequests.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def json(self):


def get_entity_class(url):
klass = ''
url_split = url.split("/")
if ENTITY_CLASS_MAPPING.get(url_split[-1]):
# generic request .i.e. '/<entity>'
Expand Down
2 changes: 1 addition & 1 deletion PyPowerStore/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@
RESTORE_FILESYSTEM_URL = "https://{0}/api/rest/file_system/{1}/restore"

MODIFY_FILESYSTEM_URL = GET_FILESYSTEM_DETAILS_URL
CREATE_FILESYSTEM_SNAPSHOT_URL = "https://{0}/api/rest/file_system/{1}/" "snapshot"
CREATE_FILESYSTEM_SNAPSHOT_URL = "https://{0}/api/rest/file_system/{1}/snapshot"
GET_SNAPSHOTS_FILESYSTEM_URL = GET_FILE_SYSTEM_LIST_URL

# Network endpoints
Expand Down
41 changes: 0 additions & 41 deletions pylint_issue.log

This file was deleted.

0 comments on commit bb77bfd

Please sign in to comment.