101
101
https_authdigests = user_db_filename
102
102
103
103
104
+ _USERADM_CONFIG_DIR_KEYS = ('user_db_home' , 'user_home' , 'user_settings' ,
105
+ 'user_cache' , 'mrsl_files_dir' , 'resource_pending' )
106
+
107
+
104
108
def init_user_adm (dynamic_db_path = True ):
105
109
"""Shared init function for all user administration scripts.
106
110
The optional dynamic_db_path argument toggles dynamic user db path lookup
@@ -461,12 +465,12 @@ def _check_directories_unprovisioned(configuration, db_path):
461
465
462
466
463
467
def _provision_directories (configuration ):
464
- for config_attr in ( 'user_db_home' , 'user_home' , 'user_settings' , 'user_cache' , 'mrsl_files_dir' , 'resource_pending' ) :
468
+ for config_attr in _USERADM_CONFIG_DIR_KEYS :
465
469
try :
466
470
dir_to_create = getattr (configuration , config_attr )
467
471
os .mkdir (dir_to_create )
468
472
except OSError as oserr :
469
- if oserr .errno != errno .ENOENT : # FileNotFoundError
473
+ if oserr .errno != errno .ENOENT : # FileNotFoundError
470
474
raise
471
475
472
476
@@ -488,7 +492,7 @@ def create_user_in_db(configuration, db_path, client_id, user, now, authorized,
488
492
try :
489
493
flock = lock_user_db (db_path )
490
494
except (IOError , OSError ) as oserr :
491
- if oserr .errno != errno .ENOENT : # FileNotFoundError
495
+ if oserr .errno != errno .ENOENT : # FileNotFoundError
492
496
raise
493
497
494
498
if _check_directories_unprovisioned (configuration , db_path = db_path ):
0 commit comments