Skip to content

Commit 062b8f1

Browse files
albu-dikujonasbardino
authored andcommitted
Allow CLI tools to operate locally (with the test config).
1 parent b0a3f93 commit 062b8f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mig/shared/conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import os
3333
import sys
3434

35+
from mig.shared.defaults import MIG_ENV
3536
from mig.shared.fileio import unpickle
3637

3738

@@ -53,6 +54,15 @@ def get_configuration_object(config_file=None, skip_log=False,
5354
else:
5455
_config_file = os.path.join(app_dir, '..', 'server',
5556
'MiGserver.conf')
57+
58+
if MIG_ENV == 'local':
59+
# A local environment is one running directly out of a checkout on a
60+
# local machine and we arrange this define only in those circumstances.
61+
# Given that logging files are unsupported in such environments, detect
62+
# this and disable them up front thus ensuring CLI tools can function.
63+
skip_log = True
64+
disable_auth_log = True
65+
5666
configuration = Configuration(_config_file, False, skip_log,
5767
disable_auth_log)
5868
return configuration

0 commit comments

Comments
 (0)