Commit d7496eaf authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

[runner] add logging when we remove all instances inside a webrunner.

This shall be helpful when debugging why the data disappeared from a
webrunner.
parent 73448779
...@@ -562,6 +562,7 @@ def configNewSR(config, projectpath): ...@@ -562,6 +562,7 @@ def configNewSR(config, projectpath):
if folder: if folder:
sup_process.stopProcess(config, 'slapgrid-cp') sup_process.stopProcess(config, 'slapgrid-cp')
sup_process.stopProcess(config, 'slapgrid-sr') sup_process.stopProcess(config, 'slapgrid-sr')
logger.warning("User opened a new SR. Removing all instances...")
removeCurrentInstance(config) removeCurrentInstance(config)
open(os.path.join(config['etc_dir'], ".project"), 'w').write(projectpath) open(os.path.join(config['etc_dir'], ".project"), 'w').write(projectpath)
return True return True
...@@ -600,6 +601,7 @@ def newSoftware(folder, config, session): ...@@ -600,6 +601,7 @@ def newSoftware(folder, config, session):
removeProxyDb(config) removeProxyDb(config)
startProxy(config) startProxy(config)
#Stop runngin process and remove existing instance #Stop runngin process and remove existing instance
logger.warning("User created a new SR. Removing all instances...")
removeCurrentInstance(config) removeCurrentInstance(config)
session['title'] = getProjectTitle(config) session['title'] = getProjectTitle(config)
code = 1 code = 1
...@@ -678,6 +680,7 @@ def removeSoftwareByName(config, md5, folder_name): ...@@ -678,6 +680,7 @@ def removeSoftwareByName(config, md5, folder_name):
return (0, "Software installation or instantiation in progress, cannot remove") return (0, "Software installation or instantiation in progress, cannot remove")
if getSoftwareReleaseName(config) == folder_name: if getSoftwareReleaseName(config) == folder_name:
logger.warning("User removed the SR currently used. Removing all instances...")
removeCurrentInstance(config) removeCurrentInstance(config)
result = removeSoftwareRootDirectory(config, md5, folder_name) result = removeSoftwareRootDirectory(config, md5, folder_name)
......
...@@ -215,6 +215,7 @@ def supervisordStatus(): ...@@ -215,6 +215,7 @@ def supervisordStatus():
def removeInstance(): def removeInstance():
logger.warning("User clicked on 'Destroy All Services'. Removing all instances...")
result = removeCurrentInstance(app.config) result = removeCurrentInstance(app.config)
if isinstance(result, str): if isinstance(result, str):
flash(result) flash(result)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment