Revision adcfcd8c

b/snf-cyclades-app/synnefo/ui/settings.py
33 33
#
34 34

  
35 35
import synnefo.cyclades_settings as cyclades
36
from synnefo.cyclades_settings import cyclades_services, astakos_services
36 37

  
37 38
from synnefo.lib import join_urls
39
from synnefo.lib.services import get_public_endpoint
40

  
38 41
from django.conf import settings
39 42

  
43
BASE_PATH = cyclades.BASE_PATH
44
if not BASE_PATH.startswith("/"):
45
    BASE_PATH = "/" + BASE_PATH
40 46

  
41
ASTAKOS_VIEWS_URL = join_urls(cyclades.ASTAKOS_BASE_URL,
42
                              cyclades.ASTAKOS_VIEWS_PREFIX)
47
GLANCE_URL = get_public_endpoint(cyclades_services, 'image', 'v1.0')
48
COMPUTE_URL = get_public_endpoint(cyclades_services, 'compute', 'v2.0')
49
USERDATA_URL = get_public_endpoint(cyclades_services, 'cyclades_userdata', '')
50
ASTAKOS_UI_URL = get_public_endpoint(astakos_services, 'astakos_ui', '')
43 51

  
44
ASTAKOS_ACCOUNTS_URL = join_urls(cyclades.ASTAKOS_BASE_URL,
45
                                 cyclades.ASTAKOS_ACCOUNTS_PREFIX)
46 52
if cyclades.PROXY_USER_SERVICES:
47
    ASTAKOS_ACCOUNTS_URL = join_urls('/', cyclades.BASE_ASTAKOS_PROXY_PATH,
48
                                     cyclades.ASTAKOS_ACCOUNTS_PREFIX)
53
    ACCOUNT_URL = join_urls('/', cyclades.BASE_ASTAKOS_PROXY_PATH,
54
                            cyclades.ASTAKOS_ACCOUNTS_PREFIX, 'v1.0')
55
else:
56
    ACCOUNT_URL = get_public_endpoint(astakos_services, 'account', 'v1.0')
49 57

  
50 58

  
51
BASE_PATH = cyclades.BASE_PATH
52
if not BASE_PATH.startswith("/"):
53
    BASE_PATH = "/" + BASE_PATH
59
USER_CATALOG_URL = join_urls(ACCOUNT_URL, 'user_catalogs')
60
FEEDBACK_URL = join_urls(ACCOUNT_URL, 'feedback')
54 61

  
55
ACCOUNTS_URL = getattr(settings, 'CYCLADES_UI_ACCOUNTS_URL',
56
                       join_urls(ASTAKOS_ACCOUNTS_URL))
57
USER_CATALOG_URL = getattr(settings, 'CYCLADES_UI_USER_CATALOG_URL',
58
                           join_urls(ACCOUNTS_URL, 'user_catalogs'))
59
FEEDBACK_URL = getattr(settings, 'CYCLADES_UI_FEEDBACK_URL',
60
                       join_urls(ACCOUNTS_URL, 'feedback'))
61
COMPUTE_URL = getattr(settings, 'CYCLADES_UI_COMPUTE_URL',
62
                      join_urls(BASE_PATH, cyclades.COMPUTE_PREFIX,
63
                                'v1.1'))
64
GLANCE_URL = getattr(settings, 'CYCLADES_UI_GLANCE_URL',
65
                     join_urls(BASE_PATH, cyclades.PLANKTON_PREFIX + '/v1'))
66
USERDATA_URL = getattr(settings, 'CYCLADES_UI_USERDATA_URL',
67
                       join_urls(BASE_PATH, cyclades.USERDATA_PREFIX))
68
LOGIN_URL = getattr(settings, 'CYCLADES_UI_LOGIN_URL',
69
                    join_urls(cyclades.ASTAKOS_BASE_URL,
70
                              cyclades.ASTAKOS_VIEWS_PREFIX, 'login'))
71
LOGOUT_REDIRECT = getattr(settings, 'CYCLADES_UI_LOGOUT_REDIRECT', LOGIN_URL)
62
LOGIN_URL = join_urls(ASTAKOS_UI_URL, 'login')
63
LOGOUT_REDIRECT = LOGIN_URL
b/snf-cyclades-app/synnefo/ui/views.py
192 192
               'compute_api_url': json.dumps(uisettings.COMPUTE_URL),
193 193
               'user_catalog_url': json.dumps(uisettings.USER_CATALOG_URL),
194 194
               'feedback_post_url': json.dumps(uisettings.FEEDBACK_URL),
195
               'accounts_api_url': json.dumps(uisettings.ACCOUNTS_URL),
195
               'accounts_api_url': json.dumps(uisettings.ACCOUNT_URL),
196 196
               'logout_redirect': json.dumps(uisettings.LOGOUT_REDIRECT),
197 197
               'login_redirect': json.dumps(uisettings.LOGIN_URL),
198 198
               'glance_api_url': json.dumps(uisettings.GLANCE_URL),

Also available in: Unified diff