mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 14:08:07 +00:00
Fix dynamic app init issue; Require data drive for app init
This commit is contained in:
parent
3aa4b29888
commit
510ba83ec0
|
@ -607,6 +607,11 @@ def init_dynamic_app(app_info):
|
||||||
log_message(" Done.")
|
log_message(" Done.")
|
||||||
|
|
||||||
def init_dynamic_apps():
|
def init_dynamic_apps():
|
||||||
|
# Ensure external drive is mounted
|
||||||
|
if not is_mynode_drive_mounted():
|
||||||
|
log_message(" ERROR: Data drive not mounted")
|
||||||
|
return
|
||||||
|
|
||||||
# Loop over each app
|
# Loop over each app
|
||||||
root_app_dir = get_dynamic_app_dir()
|
root_app_dir = get_dynamic_app_dir()
|
||||||
app_names = get_dynamic_app_names()
|
app_names = get_dynamic_app_names()
|
||||||
|
@ -614,13 +619,13 @@ def init_dynamic_apps():
|
||||||
log_message("Found Application: {}".format(app_name))
|
log_message("Found Application: {}".format(app_name))
|
||||||
app_dir = root_app_dir + "/" + app_name
|
app_dir = root_app_dir + "/" + app_name
|
||||||
try:
|
try:
|
||||||
app_json_path = app_dir + "/app.json"
|
app_json_path = app_dir + "/{}.json".format(app_name)
|
||||||
with open(app_json_path, 'r') as fp:
|
with open(app_json_path, 'r') as fp:
|
||||||
app_info = json.load(fp)
|
app_info = json.load(fp)
|
||||||
init_dynamic_app(app_info)
|
init_dynamic_app(app_info)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log_message(" ERROR: Error loading app.json file ({})".format(str(e)))
|
log_message(" ERROR: Error loading {}.json file ({})".format(app_name, str(e)))
|
||||||
|
|
||||||
# Reload systemctl files
|
# Reload systemctl files
|
||||||
os.system("systemctl daemon-reload")
|
os.system("systemctl daemon-reload")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user