Commit 3b36b1e3 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou

Refactored common synnefo settings as python modules

parent 4d86b3ed
......@@ -34,7 +34,8 @@
import os.path
import glob
from synnefo.settings_common import *
# import common settings
from synnefo.settings.common import *
SYNNEFO_DIST_SETTINGS_DIR = '/etc/synnefo'
......
......@@ -31,12 +31,20 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
import os.path
import glob
conffiles = glob.glob(os.path.join(os.path.dirname(__file__),
'settings.d', '*.conf'))
conffiles.sort()
for f in conffiles:
execfile(os.path.abspath(f))
from synnefo.settings.common.admins import *
from synnefo.settings.common.apps import *
from synnefo.settings.common.deploy import *
from synnefo.settings.common.logging import *
from synnefo.settings.common.site import *
from synnefo.settings.common.backend import *
from synnefo.settings.common.database import *
from synnefo.settings.common.queues import *
from synnefo.settings.common.api import *
from synnefo.settings.common.ui import *
from synnefo.settings.common.userdata import *
from synnefo.settings.common.aai import *
from synnefo.settings.common.invitations import *
from synnefo.settings.common.reconciliation import *
from synnefo.settings.common.helpdesk import *
from synnefo.settings.common.tests import *
......@@ -3,6 +3,8 @@
# API configuration
#####################
from deploy import *
# The API implementation needs to accept and return absolute references
# to its resources. Thus, it needs to know its public URL.
API_ROOT_URL = APP_INSTALL_URL + '/api'
......
......@@ -3,15 +3,16 @@
# Database settings
####################
PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
import os
DEFAULT_DB_PATH = '/usr/share/synnefo/'
DATABASES = {
'default': {
# 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
'ENGINE': 'sqlite3',
# ATTENTION: This *must* be the absolute path if using sqlite3.
# See: http://docs.djangoproject.com/en/dev/ref/settings/#name
'NAME': os.path.join(PROJECT_PATH, 'database.sqlite'),
'NAME': os.path.join(DEFAULT_DB_PATH, 'database.sqlite'),
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
# Set to empty string for localhost. Not used with sqlite3.
......
......@@ -5,7 +5,7 @@
# A quick-n-dirty way which sets settings.TEST
# if we're running unit tests.
import sys
import sys, os
TEST = False
if len(sys.argv) >= 2:
if os.path.basename(sys.argv[0]) == 'manage.py' and \
......
......@@ -3,8 +3,10 @@
# UI settings
###################
from admins import *
# base url for ui static files
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
# if not set, defaults to MEDIA_URL + 'snf-<latest_ui_version>/'
#UI_MEDIA_URL = MEDIA_URL + 'snf/'
# UI requests to the API layer time out after that many milliseconds
......@@ -44,7 +46,7 @@ FEEDBACK_EMAIL_FROM = DEFAULT_FROM_EMAIL
# settings.LOGIN_URL will be used)
#LOGOUT_URL = ""
# Flavor options that we provide to the user as predefined
# Flavor options that we provide to the user as predefined
# cpu/ram/disk combinations on vm create wizard
VM_CREATE_SUGGESTED_FLAVORS = {
'small': {
......@@ -92,10 +94,10 @@ UI_FLAVORS_DISK_TEMPLATES_INFO = {
#######################
# Whether to increase the time of recurrent requests (networks/vms update) if
# window loses its focus
# window loses its focus
UI_DELAY_ON_BLUR = False
# Whether not visible vm views will update their content if vm changes
# Whether not visible vm views will update their content if vm changes
UI_UPDATE_HIDDEN_VIEWS = False
# After how many timeouts of reccurent ajax requests to display the timeout
......@@ -110,7 +112,7 @@ UI_SUPPORT_SSH_OS_LIST = ['debian', 'fedora', 'okeanos', 'ubuntu', 'kubuntu', 'c
# OS/username map to identify default user name for the specified os
UI_OS_DEFAULT_USER_MAP = {
'debian':'root', 'fedora': 'root', 'okeanos': 'root',
'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
'debian':'root', 'fedora': 'root', 'okeanos': 'root',
'ubuntu': 'root', 'kubuntu': 'root', 'centos': 'root',
'windows': 'Administrator'
}
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