~gandelman-a/charms/precise/openstack-dashboard/request_role

« back to all changes in this revision

Viewing changes to hooks/local_settings.py

  • Committer: Adam Gandelman
  • Date: 2011-12-24 01:37:51 UTC
  • Revision ID: adamg@canonical.com-20111224013751-r0s3ol9amtonqbrh
Some cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
###
2
 
# Juju managed local_settings.py for Horizon / openstack-dashboard
3
 
# Closely based on local_settings.py.example shipped with Horizon
4
 
import os
5
 
import sys
6
 
 
7
 
# various defaults shipped in this file in ubuntu packaging.
8
 
# these will be used if juju generated configuration doesn't exist (yet)
9
 
OPENSTACK_HOST="127.0.0.1"
10
 
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST
11
 
OPENSTACK_KEYSTONE_ADMIN_URL = "http://%s:35357/v2.0" % OPENSTACK_HOST
12
 
OPENSTACK_KEYSTONE_DEFAULT_ROLE = "Member"
13
 
 
14
 
DEBUG = True
15
 
TEMPLATE_DEBUG = DEBUG
16
 
PROD = False
17
 
USE_SSL = False
18
 
# end defaults
19
 
 
20
 
sys.path.append("/etc/openstack-dashboard")
21
 
try:
22
 
    # import /etc/openstack-dashboard/juju_dashboard_config.py
23
 
    # which contains charm generated configuration
24
 
    import juju_dashboard_config
25
 
 
26
 
    # use the bits of config that have been set, rely on defaults
27
 
    # for those that haven't.
28
 
    if hasattr(juju_dashboard_config, "KEYSTONE_HOST"):
29
 
        OPENSTACK_HOST = juju_dashboard_config.KEYSTONE_HOST
30
 
    if hasattr(juju_dashboard_config, "KEYSTONE_URL"):
31
 
        OPENSTACK_KEYSTONE_URL = juju_dashboard_config.KEYSTONE_URL
32
 
    if hasattr(juju_dashboard_config, "KEYSTONE_ADMIN_URL"):
33
 
        OPENSTACK_KEYSTONE_ADMIN_URL = juju_dashboard_config.KEYSTONE_ADMIN_URL
34
 
    if hasattr(juju_dashboard_config, "KEYSTONE_ROLE"):
35
 
        OPENSTACK_KEYSTONE_ROLE = juju_dashboard_config.KEYSTONE_ROLE
36
 
except ImportError:
37
 
    # juju config is missing, but fall back to defaults set above.
38
 
    print "Could not import juju_dashboard_config. Falling back to defaults"
39
 
 
40
 
LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
41
 
DATABASES = {
42
 
    'default': {
43
 
        'ENGINE': 'django.db.backends.sqlite3',
44
 
        'NAME': '/var/lib/openstack-dashboard/dashboard_openstack.sqlite',
45
 
        'TEST_NAME': os.path.join(LOCAL_PATH, 'test.sqlite3'),
46
 
    },
47
 
}
48
 
 
49
 
# We recommend you use memcached for development; otherwise after every reload
50
 
# of the django development server, you will have to login again. To use
51
 
# memcached set CACHE_BACKED to something like 'memcached://127.0.0.1:11211/' 
52
 
CACHE_BACKEND = 'locmem://'
53
 
 
54
 
# Send email to the console by default
55
 
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
56
 
# Or send them to /dev/null
57
 
#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
58
 
 
59
 
# Configure these for your outgoing email host
60
 
# EMAIL_HOST = 'smtp.my-company.com'
61
 
# EMAIL_PORT = 25
62
 
# EMAIL_HOST_USER = 'djangomail'
63
 
# EMAIL_HOST_PASSWORD = 'top-secret!'
64
 
 
65
 
HORIZON_CONFIG = {
66
 
    'dashboards': ('nova', 'syspanel', 'settings',),
67
 
    'default_dashboard': 'nova',
68
 
    'user_home': 'dashboard.views.user_home',
69
 
}
70
 
 
71
 
# The number of Swift containers and objects to display on a single page before
72
 
# providing a paging element (a "more" link) to paginate results.
73
 
SWIFT_PAGINATE_LIMIT = 1000
74
 
 
75
 
# Configure quantum connection details for networking
76
 
QUANTUM_ENABLED = False
77
 
QUANTUM_URL = '%s'  % OPENSTACK_HOST
78
 
QUANTUM_PORT = '9696'
79
 
QUANTUM_TENANT = '1234'
80
 
QUANTUM_CLIENT_VERSION='0.1'
81
 
 
82
 
# If you have external monitoring links, eg:
83
 
# EXTERNAL_MONITORING = [
84
 
#     ['Nagios','http://foo.com'],
85
 
#     ['Ganglia','http://bar.com'],
86
 
# ]
87
 
 
88
 
LOGGING = {
89
 
        'version': 1,
90
 
        # When set to True this will disable all logging except
91
 
        # for loggers specified in this configuration dictionary. Note that
92
 
        # if nothing is specified here and disable_existing_loggers is True,
93
 
        # django.db.backends will still log unless it is disabled explicitly.
94
 
        'disable_existing_loggers': False,
95
 
        'handlers': {
96
 
            'null': {
97
 
                'level': 'DEBUG',
98
 
                'class': 'django.utils.log.NullHandler',
99
 
                },
100
 
            'console': {
101
 
                # Set the level to "DEBUG" for verbose output logging.
102
 
                'level': 'INFO',
103
 
                'class': 'logging.StreamHandler',
104
 
                },
105
 
            },
106
 
        'loggers': {
107
 
            # Logging from django.db.backends is VERY verbose, send to null
108
 
            # by default.
109
 
            'django.db.backends': {
110
 
                'handlers': ['null'],
111
 
                'propagate': False,
112
 
                },
113
 
            'horizon': {
114
 
                'handlers': ['console'],
115
 
                'propagate': False,
116
 
            },
117
 
            'novaclient': {
118
 
                'handlers': ['console'],
119
 
                'propagate': False,
120
 
            },
121
 
            'keystoneclient': {
122
 
                'handlers': ['console'],
123
 
                'propagate': False,
124
 
            },
125
 
            'nose.plugins.manager': {
126
 
                'handlers': ['console'],
127
 
                'propagate': False,
128
 
            }
129
 
        }
130
 
}
131
 
 
132
 
# How much ram on each compute host?
133
 
COMPUTE_HOST_RAM_GB = 16