@@ -195,10 +195,9 @@ def cleanup(self, new_host = ''):
195
195
self .__configured = self .configure (** self .do_configure )
196
196
197
197
def _configure_account (self , ** kwargs ):
198
-
198
+ env_file = None
199
199
try :
200
200
env_file = kwargs ['irods_env_file' ]
201
-
202
201
except KeyError :
203
202
# For backward compatibility
204
203
for key in ['host' , 'port' , 'authentication_scheme' ]:
@@ -217,6 +216,9 @@ def _configure_account(self, **kwargs):
217
216
# Update with new keywords arguments only
218
217
creds .update ((key , value ) for key , value in kwargs .items () if key not in creds )
219
218
219
+ if env_file :
220
+ creds ['env_file' ] = env_file
221
+
220
222
# Get auth scheme
221
223
try :
222
224
auth_scheme = creds ['irods_authentication_scheme' ]
@@ -244,10 +246,11 @@ def _configure_account(self, **kwargs):
244
246
missing_file_path = []
245
247
error_args = []
246
248
pw = creds ['password' ] = self .get_irods_password (session_ = self , file_path_if_not_found = missing_file_path , ** creds )
247
- if not pw and creds .get ('irods_user_name' ) != 'anonymous' :
248
- if missing_file_path :
249
- error_args += ["Authentication file not found at {!r}" .format (missing_file_path [0 ])]
250
- raise NonAnonymousLoginWithoutPassword (* error_args )
249
+ if auth_scheme .lower () not in PAM_AUTH_SCHEMES :
250
+ if not pw and creds .get ('irods_user_name' ) != 'anonymous' :
251
+ if missing_file_path :
252
+ error_args += ["Authentication file not found at {!r}" .format (missing_file_path [0 ])]
253
+ raise NonAnonymousLoginWithoutPassword (* error_args )
251
254
252
255
return iRODSAccount (** creds )
253
256
0 commit comments