Fix for logging before creating log directory on new install.

pull/684/head v0.8.3.1
Louis Vézina 5 years ago
parent 74b2787ac3
commit c81da4aa7e

@ -1,7 +1,6 @@
# coding=utf-8
import os
import logging
import time
import rarfile
@ -9,6 +8,7 @@ from cork import Cork
from ConfigParser2 import ConfigParser
from config import settings
from get_args import args
from logger import configure_logging
from dogpile.cache.region import register_backend as register_cache_backend
import subliminal
@ -33,24 +33,21 @@ if not os.path.exists(args.config_dir):
# Create config_dir directory tree
try:
os.mkdir(os.path.join(args.config_dir))
logging.debug("BAZARR Created data directory")
except OSError:
logging.exception(
"BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?).")
print "BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?)."
exit(2)
if not os.path.exists(os.path.join(args.config_dir, 'config')):
os.mkdir(os.path.join(args.config_dir, 'config'))
logging.debug("BAZARR Created config folder")
if not os.path.exists(os.path.join(args.config_dir, 'db')):
os.mkdir(os.path.join(args.config_dir, 'db'))
logging.debug("BAZARR Created db folder")
if not os.path.exists(os.path.join(args.config_dir, 'log')):
os.mkdir(os.path.join(args.config_dir, 'log'))
logging.debug("BAZARR Created log folder")
if not os.path.exists(os.path.join(args.config_dir, 'cache')):
os.mkdir(os.path.join(args.config_dir, 'cache'))
logging.debug("BAZARR Created cache folder")
configure_logging(settings.general.getboolean('debug') or args.debug)
import logging
# create database file
if not os.path.exists(os.path.join(args.config_dir, 'db', 'bazarr.db')):

@ -25,12 +25,11 @@ import operator
from calendar import day_name
from get_args import args
from logger import configure_logging, empty_log
from logger import empty_log
from config import settings, url_sonarr, url_radarr, url_radarr_short, url_sonarr_short, base_url
configure_logging(settings.general.getboolean('debug') or args.debug)
from init import *
import logging
from database import database, dict_mapper
from notifier import update_notifier

Loading…
Cancel
Save