Skip to content

Commit 7f34550

Browse files
committed
fixup
1 parent 0ce3708 commit 7f34550

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

mig/server/createuser.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def usage(name='createuser.py'):
9292
""" % {'name': name, 'cert_warn': cert_warn})
9393

9494

95-
def main(args, cwd, db_path=keyword_auto):
95+
def main(_main, args, cwd, db_path=keyword_auto):
9696
conf_path = None
9797
auth_type = 'custom'
9898
expire = None
@@ -170,7 +170,12 @@ def main(args, cwd, db_path=keyword_auto):
170170
print('Error: %s not supported!' % opt)
171171
sys.exit(1)
172172

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):
174179
print('Failed to read configuration file: %s' % conf_path)
175180
sys.exit(1)
176181

@@ -379,4 +384,4 @@ def _main(configuration, args,
379384

380385
if __name__ == '__main__':
381386
(args, cwd, db_path) = init_user_adm()
382-
main(args, cwd, db_path=db_path)
387+
main(_main, args, cwd, db_path=db_path)

mig/shared/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def get_configuration_object(config_file=None, skip_log=False,
5353
else:
5454
_config_file = os.path.join(app_dir, '..', 'server',
5555
'MiGserver.conf')
56+
_config_file = os.path.normpath(_config_file)
5657
configuration = Configuration(_config_file, False, skip_log,
5758
disable_auth_log)
5859
return configuration

0 commit comments

Comments
 (0)