mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
fix critical bug to support relative path for crafty logs. Crafty's root path is set by main.py and saved in controller.
This commit is contained in:
parent
1ee8342355
commit
64b62f0f4f
@ -130,6 +130,10 @@ class Controller:
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def set_project_root(self, root_dir):
|
||||||
|
self.project_root = root_dir
|
||||||
|
|
||||||
|
|
||||||
def package_support_logs(self, exec_user):
|
def package_support_logs(self, exec_user):
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
websocket_helper.broadcast_user(exec_user['user_id'], 'notification', 'Preparing your support logs')
|
websocket_helper.broadcast_user(exec_user['user_id'], 'notification', 'Preparing your support logs')
|
||||||
@ -159,7 +163,7 @@ class Controller:
|
|||||||
shutil.copy(server['log_path'], final_path)
|
shutil.copy(server['log_path'], final_path)
|
||||||
#Copy crafty logs to archive dir
|
#Copy crafty logs to archive dir
|
||||||
full_log_name = os.path.join(crafty_path, 'logs')
|
full_log_name = os.path.join(crafty_path, 'logs')
|
||||||
shutil.copytree("logs", full_log_name)
|
shutil.copytree(os.path.join(self.project_root, 'logs'), full_log_name)
|
||||||
shutil.make_archive(tempZipStorage, "zip", tempDir)
|
shutil.make_archive(tempZipStorage, "zip", tempDir)
|
||||||
|
|
||||||
tempZipStorage += '.zip'
|
tempZipStorage += '.zip'
|
||||||
|
3
main.py
3
main.py
@ -151,6 +151,9 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
Crafty = MainPrompt(tasks_manager, migration_manager)
|
Crafty = MainPrompt(tasks_manager, migration_manager)
|
||||||
|
|
||||||
|
project_root = os.path.dirname(__file__)
|
||||||
|
controller.set_project_root(project_root)
|
||||||
|
|
||||||
def sigterm_handler(signum, current_stack_frame):
|
def sigterm_handler(signum, current_stack_frame):
|
||||||
print() # for newline
|
print() # for newline
|
||||||
logger.info("Recieved SIGTERM, stopping Crafty")
|
logger.info("Recieved SIGTERM, stopping Crafty")
|
||||||
|
Loading…
Reference in New Issue
Block a user