Log a message showing the config file used

This commit is contained in:
Sunil Mohan Adapa 2014-09-02 14:47:35 +05:30
parent b12072d924
commit 27cdadbc76
3 changed files with 9 additions and 5 deletions

View File

@ -7,7 +7,6 @@ import django.core.wsgi
import logging
import os
import stat
import sys
import cherrypy
from cherrypy import _cpserver
@ -219,6 +218,8 @@ def main():
configure_django()
LOGGER.info('Configuration loaded from file - %s', cfg.CONFIG_FILE)
module_loader.load_modules()
setup_server()

View File

@ -1,4 +1,4 @@
from menu import Menu
from plinth.menu import Menu
import os
import ConfigParser
@ -23,25 +23,27 @@ server_dir = '/'
main_menu = Menu()
CONFIG_FILE = None
DEFAULT_CONFIG_FILE = '/etc/plinth/plinth.config'
DEFAULT_ROOT = '/'
def read():
"""Read configuration"""
global CONFIG_FILE # pylint: disable-msg=W0603
if os.path.isfile(DEFAULT_CONFIG_FILE):
config_file = DEFAULT_CONFIG_FILE
CONFIG_FILE = DEFAULT_CONFIG_FILE
directory = DEFAULT_ROOT
else:
directory = os.path.dirname(os.path.realpath(__file__))
directory = os.path.join(directory, '..')
config_file = os.path.join(directory, 'plinth.config')
CONFIG_FILE = os.path.join(directory, 'plinth.config')
parser = SafeConfigParser(
defaults={
'root': os.path.realpath(directory),
})
parser.read(config_file)
parser.read(CONFIG_FILE)
config_items = {('Name', 'product_name'),
('Name', 'box_name'),

View File

@ -42,6 +42,7 @@ DIRECTORIES_TO_COPY = [
('/usr/share/doc/plinth/', 'doc'),
]
class CustomInstallData(install_data):
"""Override install command to allow directory creation and copy"""
def run(self):