Revision 3ab15f84 snf-cyclades-app/synnefo/cyclades_settings.py
b/snf-cyclades-app/synnefo/cyclades_settings.py | ||
---|---|---|
33 | 33 |
|
34 | 34 |
from django.conf import settings |
35 | 35 |
from synnefo.lib import join_urls, parse_base_url |
36 |
from synnefo.util.keypath import get_path |
|
37 |
from synnefo.api.services import cyclades_services as vanilla_cyclades_services |
|
38 |
from astakosclient import astakos_services as vanilla_astakos_services |
|
39 |
|
|
40 |
from copy import deepcopy |
|
36 | 41 |
|
37 | 42 |
BASE_URL = getattr(settings, 'CYCLADES_BASE_URL', |
38 | 43 |
'https://compute.example.synnefo.org/compute/') |
... | ... | |
42 | 47 |
'https://accounts.example.synnefo.org/astakos/') |
43 | 48 |
ASTAKOS_BASE_HOST, ASTAKOS_BASE_PATH = parse_base_url(ASTAKOS_BASE_URL) |
44 | 49 |
|
45 |
COMPUTE_PREFIX = getattr(settings, 'CYCLADES_COMPUTE_PREFIX', 'compute') |
|
46 |
VMAPI_PREFIX = getattr(settings, 'CYCLADES_VMAPI_PREFIX', 'vmapi') |
|
47 |
PLANKTON_PREFIX = getattr(settings, 'CYCLADES_PLANKTON_PREFIX', 'plankton') |
|
48 |
HELPDESK_PREFIX = getattr(settings, 'CYCLADES_HELPDESK_PREFIX', 'helpdesk') |
|
49 |
UI_PREFIX = getattr(settings, 'CYCLADES_UI_PREFIX', 'ui') |
|
50 |
USERDATA_PREFIX = getattr(settings, 'CYCLADES_USERDATA_PREFIX', 'userdata') |
|
50 |
CUSTOMIZE_SERVICES = getattr(settings, 'CYCLADES_CUSTOMIZE_SERVICES', ()) |
|
51 |
cyclades_services = deepcopy(vanilla_cyclades_services) |
|
52 |
for path, value in CUSTOMIZE_SERVICES: |
|
53 |
set_path(cyclades_services, path, value, createpath=True) |
|
54 |
|
|
55 |
astakos_services = deepcopy(vanilla_astakos_services) |
|
56 |
CUSTOMIZE_ASTAKOS_SERVICES = \ |
|
57 |
getattr(settings, 'CYCLADES_CUSTOMIZE_ASTAKOS_SERVICES', ()) |
|
58 |
for path, value in CUSTOMIZE_ASTAKOS_SERVICES: |
|
59 |
set_path(astakos_services, path, value, createpath=True) |
|
60 |
|
|
61 |
COMPUTE_PREFIX = get_path(cyclades_services, 'cyclades_compute.prefix') |
|
62 |
VMAPI_PREFIX = get_path(cyclades_services, 'cyclades_vmapi.prefix') |
|
63 |
PLANKTON_PREFIX = get_path(cyclades_services, 'cyclades_plankton.prefix') |
|
64 |
HELPDESK_PREFIX = get_path(cyclades_services, 'cyclades_helpdesk.prefix') |
|
65 |
UI_PREFIX = get_path(cyclades_services, 'cyclades_ui.prefix') |
|
66 |
USERDATA_PREFIX = get_path(cyclades_services, 'cyclades_userdata.prefix') |
|
67 |
|
|
68 |
ASTAKOS_ACCOUNTS_PREFIX = get_path(astakos_services, 'astakos_account.prefix') |
|
69 |
ASTAKOS_VIEWS_PREFIX = get_path(astakos_services, 'astakos_ui.prefix') |
|
70 |
ASTAKOS_KEYSTONE_PREFIX = get_path(astakos_services, 'astakos_keystone.prefix') |
|
51 | 71 |
|
52 | 72 |
# The API implementation needs to accept and return absolute references |
53 | 73 |
# to its resources. Thus, it needs to know its public URL. |
... | ... | |
59 | 79 |
BASE_ASTAKOS_PROXY_PATH = join_urls(BASE_PATH, BASE_ASTAKOS_PROXY_PATH) |
60 | 80 |
BASE_ASTAKOS_PROXY_PATH = BASE_ASTAKOS_PROXY_PATH.strip('/') |
61 | 81 |
|
62 |
ASTAKOS_ACCOUNTS_PREFIX = getattr(settings, |
|
63 |
'ASTAKOS_ACCOUNTS_PREFIX', 'accounts').strip('/') |
|
64 |
|
|
65 |
ASTAKOS_VIEWS_PREFIX = getattr(settings, |
|
66 |
'ASTAKOS_VIEWS_PREFIX', 'im').strip('/') |
|
67 |
|
|
68 |
ASTAKOS_KEYSTONE_PREFIX = getattr(settings, |
|
69 |
'ASTAKOS_KEYSTONE_PREFIX', |
|
70 |
'keystone').strip('/') |
|
71 |
|
|
72 | 82 |
PROXY_USER_SERVICES = getattr(settings, 'CYCLADES_PROXY_USER_SERVICES', True) |
Also available in: Unified diff