Added more logging

This commit is contained in:
Shuai Lin 2018-10-13 08:45:08 +08:00
parent a1d1369680
commit 4ebe259534
2 changed files with 5 additions and 1 deletions

View file

@ -15,7 +15,7 @@ import time
from utils import (
call, get_conf, get_install_dir, get_script, get_command_output,
render_template, wait_for_mysql
render_template, wait_for_mysql, setup_logging
)
from upgrade import check_upgrade
from bootstrap import init_seafile_server, is_https, init_letsencrypt, generate_local_nginx_conf
@ -82,4 +82,5 @@ def main():
sys.exit(0)
if __name__ == '__main__':
setup_logging()
main()

View file

@ -8,6 +8,7 @@ This script is used to run proper upgrade scripts automatically.
import json
import re
import glob
import logging
import os
from os.path import abspath, basename, exists, dirname, join, isdir
import shutil
@ -21,6 +22,7 @@ from utils import (
installdir = get_install_dir()
topdir = dirname(installdir)
logger = logging.getLogger(__name__)
def collect_upgrade_scripts(from_version, to_version):
"""
@ -53,6 +55,7 @@ def parse_upgrade_script_version(script):
return m.groups()
def run_script_and_update_version_stamp(script, new_version):
logging.info('Running script %s', script)
replace_file_pattern(script, 'read dummy', '')
call(script)
update_version_stamp(new_version)