@@ -210,10 +210,9 @@ def cleanup(self, new_host = ''):
210210 self .__configured = self .configure (** self .do_configure )
211211
212212 def _configure_account (self , ** kwargs ):
213-
213+ env_file = None
214214 try :
215215 env_file = kwargs ['irods_env_file' ]
216-
217216 except KeyError :
218217 # For backward compatibility
219218 for key in ['host' , 'port' , 'authentication_scheme' ]:
@@ -232,6 +231,9 @@ def _configure_account(self, **kwargs):
232231 # Update with new keywords arguments only
233232 creds .update ((key , value ) for key , value in kwargs .items () if key not in creds )
234233
234+ if env_file :
235+ creds ['env_file' ] = env_file
236+
235237 # Get auth scheme
236238 try :
237239 auth_scheme = creds ['irods_authentication_scheme' ]
@@ -259,10 +261,11 @@ def _configure_account(self, **kwargs):
259261 missing_file_path = []
260262 error_args = []
261263 pw = creds ['password' ] = self .get_irods_password (session_ = self , file_path_if_not_found = missing_file_path , ** creds )
262- if not pw and creds .get ('irods_user_name' ) != 'anonymous' :
263- if missing_file_path :
264- error_args += ["Authentication file not found at {!r}" .format (missing_file_path [0 ])]
265- raise NonAnonymousLoginWithoutPassword (* error_args )
264+ if auth_scheme .lower () not in PAM_AUTH_SCHEMES :
265+ if not pw and creds .get ('irods_user_name' ) != 'anonymous' :
266+ if missing_file_path :
267+ error_args += ["Authentication file not found at {!r}" .format (missing_file_path [0 ])]
268+ raise NonAnonymousLoginWithoutPassword (* error_args )
266269
267270 return iRODSAccount (** creds )
268271
0 commit comments