Skip to content

Commit

Permalink
Version 1.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
filak committed Jan 25, 2024
1 parent 5d31c52 commit aec088f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion flask-app/application/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def create_app(debug=False, logger=None, port=5900,
app.app_context().push()
### Or use: with app.app_context():

adminConfig = mtu.getConfig(app.config['admin_config_file'])
adminConfig = mtu.getConfig(app.config['admin_config_file'], admin=True)
if not adminConfig:
return

Expand Down
7 changes: 4 additions & 3 deletions flask-app/application/modules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ def get_instance_dir(app, file_path):


### Config loading
def getConfig(cfg_file):
def getConfig(cfg_file, admin=False):
cpath = Path( cfg_file )
if not cpath.is_file():
error = 'Missing Admin config file : '+ str(cfg_file)
error = 'Missing config file : '+ str(cfg_file)
app.logger.error(error)
print('ERROR: '+error)
print('Run the set-mtw-admin tool !')
if admin:
print('Run the set-mtw-admin tool !')
return
try:
config = configparser.ConfigParser()
Expand Down
2 changes: 1 addition & 1 deletion flask-app/application/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create_app(debug=False, logger=None, port=5903,
admin_config_file = mtu.get_instance_dir(app, 'conf/mtw-admin.tmp')
))

adminConfig = mtu.getConfig(app.config['admin_config_file'])
adminConfig = mtu.getConfig(app.config['admin_config_file'], admin=True)

if not adminConfig:
return
Expand Down

0 comments on commit aec088f

Please sign in to comment.