Revision 9c6d629f snf-cyclades-app/synnefo/cyclades_settings.py
b/snf-cyclades-app/synnefo/cyclades_settings.py | ||
---|---|---|
35 | 35 |
|
36 | 36 |
from django.conf import settings |
37 | 37 |
from synnefo.lib import join_urls, parse_base_url |
38 |
from synnefo.util.keypath import get_path, set_path |
|
39 | 38 |
from synnefo.api.services import cyclades_services as vanilla_cyclades_services |
40 | 39 |
from synnefo.lib.services import fill_endpoints |
41 | 40 |
from astakosclient import AstakosClient |
... | ... | |
53 | 52 |
BASE_HOST, BASE_PATH = parse_base_url(BASE_URL) |
54 | 53 |
SERVICE_TOKEN = getattr(settings, 'CYCLADES_SERVICE_TOKEN', "") |
55 | 54 |
|
56 |
CUSTOMIZE_SERVICES = getattr(settings, 'CYCLADES_CUSTOMIZE_SERVICES', ()) |
|
57 | 55 |
cyclades_services = deepcopy(vanilla_cyclades_services) |
58 | 56 |
fill_endpoints(cyclades_services, BASE_URL) |
59 |
for path, value in CUSTOMIZE_SERVICES: |
|
60 |
set_path(cyclades_services, path, value, createpath=True) |
|
61 |
|
|
62 |
COMPUTE_PREFIX = get_path(cyclades_services, 'cyclades_compute.prefix') |
|
63 |
NETWORK_PREFIX = get_path(cyclades_services, 'cyclades_network.prefix') |
|
64 |
VMAPI_PREFIX = get_path(cyclades_services, 'cyclades_vmapi.prefix') |
|
65 |
PLANKTON_PREFIX = get_path(cyclades_services, 'cyclades_plankton.prefix') |
|
66 |
HELPDESK_PREFIX = get_path(cyclades_services, 'cyclades_helpdesk.prefix') |
|
67 |
UI_PREFIX = get_path(cyclades_services, 'cyclades_ui.prefix') |
|
68 |
USERDATA_PREFIX = get_path(cyclades_services, 'cyclades_userdata.prefix') |
|
69 |
ADMIN_PREFIX = get_path(cyclades_services, 'cyclades_admin.prefix') |
|
57 |
|
|
58 |
COMPUTE_PREFIX = cyclades_services['cyclades_compute']['prefix'] |
|
59 |
NETWORK_PREFIX = cyclades_services['cyclades_network']['prefix'] |
|
60 |
VMAPI_PREFIX = cyclades_services['cyclades_vmapi']['prefix'] |
|
61 |
PLANKTON_PREFIX = cyclades_services['cyclades_plankton']['prefix'] |
|
62 |
HELPDESK_PREFIX = cyclades_services['cyclades_helpdesk']['prefix'] |
|
63 |
UI_PREFIX = cyclades_services['cyclades_ui']['prefix'] |
|
64 |
USERDATA_PREFIX = cyclades_services['cyclades_userdata']['prefix'] |
|
65 |
ADMIN_PREFIX = cyclades_services['cyclades_admin']['prefix'] |
|
70 | 66 |
|
71 | 67 |
COMPUTE_ROOT_URL = join_urls(BASE_URL, COMPUTE_PREFIX) |
72 | 68 |
|
Also available in: Unified diff