@@ -195,10 +195,9 @@ def cleanup(self, new_host = ''):
195195 self .__configured = self .configure (** self .do_configure )
196196
197197 def _configure_account (self , ** kwargs ):
198-
198+ env_file = None
199199 try :
200200 env_file = kwargs ['irods_env_file' ]
201-
202201 except KeyError :
203202 # For backward compatibility
204203 for key in ['host' , 'port' , 'authentication_scheme' ]:
@@ -217,6 +216,9 @@ def _configure_account(self, **kwargs):
217216 # Update with new keywords arguments only
218217 creds .update ((key , value ) for key , value in kwargs .items () if key not in creds )
219218
219+ if env_file :
220+ creds ['env_file' ] = env_file
221+
220222 # Get auth scheme
221223 try :
222224 auth_scheme = creds ['irods_authentication_scheme' ]
@@ -244,10 +246,11 @@ def _configure_account(self, **kwargs):
244246 missing_file_path = []
245247 error_args = []
246248 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 )
251254
252255 return iRODSAccount (** creds )
253256
0 commit comments