@@ -92,7 +92,7 @@ def usage(name='createuser.py'):
92
92
""" % {'name' : name , 'cert_warn' : cert_warn })
93
93
94
94
95
- def main (args , cwd , db_path = keyword_auto ):
95
+ def main (_main , args , cwd , db_path = keyword_auto ):
96
96
conf_path = None
97
97
auth_type = 'custom'
98
98
expire = None
@@ -170,7 +170,12 @@ def main(args, cwd, db_path=keyword_auto):
170
170
print ('Error: %s not supported!' % opt )
171
171
sys .exit (1 )
172
172
173
- if conf_path and not os .path .isfile (conf_path ):
173
+ if not conf_path :
174
+ # explicitly set the default value of keyword_auto if no option was
175
+ # provided since it is unconditionally passed inward as a keyword arg
176
+ # and thus the fallback would accidentally be ignored
177
+ conf_path = keyword_auto
178
+ elif not os .path .isfile (conf_path ):
174
179
print ('Failed to read configuration file: %s' % conf_path )
175
180
sys .exit (1 )
176
181
@@ -379,4 +384,4 @@ def _main(configuration, args,
379
384
380
385
if __name__ == '__main__' :
381
386
(args , cwd , db_path ) = init_user_adm ()
382
- main (args , cwd , db_path = db_path )
387
+ main (_main , args , cwd , db_path = db_path )
0 commit comments