Skip to content

Commit c7f2013

Browse files
committed
codacy
1 parent e3ecfa3 commit c7f2013

5 files changed

Lines changed: 12 additions & 7 deletions

File tree

irods/auth/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ class REQUEST_IS_MISSING_KEY(Exception):
130130
pass
131131

132132

133+
class ClientAuthError(Exception):
134+
pass
135+
136+
133137
def throw_if_request_message_is_missing_key(request, required_keys):
134138
for key in required_keys:
135139
if not key in request:
@@ -176,8 +180,11 @@ def call(self, next_operation, request):
176180
return resp
177181

178182
def authenticate_client(
179-
self, next_operation="auth_client_start", initial_request={}
183+
self, next_operation="auth_client_start", initial_request=()
180184
):
185+
if not isinstance(initial_request, dict):
186+
initial_request = dict(initial_request)
187+
181188
to_send = initial_request.copy()
182189
to_send["scheme"] = self.scheme
183190

irods/prc_write_irodsA.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import getopt
2-
import getpass
32
import textwrap
43
import sys
54

irods/session.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import ast
22
import atexit
3-
import contextlib
43
import copy
54
import errno
65
import json
@@ -383,10 +382,10 @@ def server_version_without_auth(self):
383382
"""Returns the same version tuple as iRODSSession's server_version property, but
384383
does not require successful authentication.
385384
"""
386-
import irods.connection
385+
from irods.connection import Connection
387386

388387
with self.clone().pool.no_auto_authenticate() as pool:
389-
return irods.connection.Connection(pool, pool.account).server_version
388+
return Connection(pool, pool.account).server_version
390389

391390
GET_SERVER_VERSION_WITHOUT_AUTH = staticmethod(
392391
lambda s: s.server_version_without_auth()

irods/test/connection_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_server_version_without_authentication__issue_688(self):
5858

5959
# Test that the older server_version property fails for the unauthorized session object.
6060
with self.assertRaises(CAT_INVALID_AUTHENTICATION):
61-
non_authenticating_session.server_version
61+
_ = non_authenticating_session.server_version
6262

6363
def test_failed_connection(self):
6464
# Make sure no connections are cached in self.sess.pool.idle to be grabbed by get_connection().

irods/test/login_auth_test_must_run_manually.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def pam_password_in_plaintext_4_3(allow=True):
118118
def new_init(self, *arg, **kw):
119119
old_init(self, *arg, **kw)
120120
self.set_auth_option_for_scheme(
121-
"pam_password", irods.auth.pam_password.ENSURE_SSL_IS_ACTIVE, not (allow)
121+
"pam_password", ENSURE_SSL_IS_ACTIVE, not (allow)
122122
)
123123

124124
with irods.helpers.temporarily_assign_attribute(iRODSSession, "__init__", new_init):

0 commit comments

Comments
 (0)