-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_99_contrib_settings.py
More file actions
180 lines (143 loc) · 4.31 KB
/
_99_contrib_settings.py
File metadata and controls
180 lines (143 loc) · 4.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# -*- coding: utf-8 -*-
# Copyright 2016 99Cloud Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
from django.utils.translation import ugettext_lazy as _ # noqa
# Dictionary of currently available angular features
ANGULAR_FEATURES = {
'images_panel': True,
'flavors_panel': True,
'users_panel': True,
}
# Settings overrides
SITE_BRANDING = 'Animbus Cloud Management Platform'
AVAILABLE_THEMES = [
('default', 'Default', 'themes/default'),
('material', 'Material', 'themes/material'),
('contrib', 'Contrib', 'themes/contrib'),
]
DEFAULT_THEME = 'contrib'
LANGUAGES = (
('en', 'English'),
('zh-cn', 'Simplified Chinese'),
)
LANGUAGE_CODE = 'zh-cn'
TIME_ZONE = "Asia/Shanghai"
SESSION_TIMEOUT = 86400
OPENSTACK_IMAGE_BACKEND = {
'image_formats': [
('', _('Select Image Format')),
('raw', _('Raw')),
('qcow2', _('QCOW2 - QEMU Emulator')),
('iso', _('ISO - Optical Disk Image')),
('aki', _('AKI - Amazon Kernel Image')),
('ari', _('ARI - Amazon Ramdisk Image'))
]
}
# Enable keystone v3
OPENSTACK_API_VERSIONS = {
"identity": 3,
}
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % 172.16.214.112
OPENSTACK_ENDPOINT_TYPE = "internalURL"
# Enable password setting in launch instance form
OPENSTACK_HYPERVISOR_FEATURES['can_set_password'] = True
# Contrib middleware
MIDDLEWARE_CLASSES += (
'openstack_dashboard.contrib.custom.middleware.ContribMiddleware',
)
# Add user login statistics for admin
AUTHENTICATION_BACKENDS = (
'openstack_dashboard.contrib.custom.animbus_backend.AnimbusKeystoneBackend',
)
INSTALLED_APPS = list(INSTALLED_APPS)
INSTALLED_APPS.append('openstack_dashboard.contrib.custom')
# Reset locale paths
LOCALE_PATHS = [
os.path.abspath(os.path.join(ROOT_PATH, '..', 'horizon/locale')),
os.path.abspath(os.path.join(ROOT_PATH, 'locale')),
]
# Contrib settings
# DB CONNECTION
CONNECTION = "mysql+pymysql://root:IHTofpOnkfHtuz4lr8Wbr27199VxcCDP7jSjsBaw@%s/animbus" % 172.16.214.112
# The OPENSTACK_HEAT_STACK settings can be used to disable password
# field required while launching the stack.
OPENSTACK_HEAT_STACK = {
'enable_user_pass': False,
}
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_USE_TLS = True
EMAIL_DIR = os.path.join(ROOT_PATH, "themes/contrib/templates/email")
DOMAIN_NAME = None
ADMIN_TOKEN = 'b2930c627e8543e892392aacfd705e5d'
RELEASE_VERSION = {
'version': 'animbus-5.6.0',
'os_version': 'Ocata'
}
SECURITY_GROUP_RULES.pop('all_tcp', None)
SECURITY_GROUP_RULES.pop('all_udp', None)
SECURITY_GROUP_RULES.pop('all_icmp', None)
REST_API_REQUIRED_SETTINGS.extend([
'HYPERVISOR_VERSION',
'HYPERVISOR',
'NEED_WORKFLOW_ROLE',
'OPENSTACK_CINDER_FEATURES',
'OPENSTACK_KEYSTONE_DEFAULT_ROLE',
'OPENSTACK_KEYSTONE_BACKEND',
'OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT',
'OPENSTACK_NEUTRON_NETWORK',
'RELEASE_VERSION',
'OPENSTACK_IMAGE_OS',
'SECURITY_GROUP_RULES',
'VOLUME_SIZE_LIMIT',
'SYSTEM_ROLES'
])
NEED_WORKFLOW_ROLE = 'workflow'
SYSTEM_PROJECTS = ["service", "services"]
SYSTEM_USERS = [
'heat_domain_admin',
'horizon',
'zabbix',
'ceph_rgw',
'ceilometer',
'magnum_trustee_domain_admin'
]
SYSTEM_ROLES = [
"_member_",
"admin",
"domain_admin",
"member",
"heat_stack_owner",
"heat_stack_user",
"workflow"
]
SITE_BRANDING = 'Animbus Cloud Management Platform'
OPENSTACK_IMAGE_OS = [
'centos',
'ubuntu',
'fedora',
'windows',
'debian',
'coreos',
'arch',
'freebsd',
'others'
]
POLICY_FILES['identity'] = 'policy.v3cloudsample.json'
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = True
VOLUME_SIZE_LIMIT = 1000
DEFAULT_PANKO_API_RETURN_LIMIT = 1000
ANIMBUS_PROJECT_NAME = 'service'
ANIMBUS_USER_NAME = "horizon"
ANIMBUS_USER_PASSWORD = "pQRHKJ6IzjaeaZ9d4GuGxbupWGcxaD8HtEXaHH3H"