Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / settings.py @ 6bd1416f

History | View | Annotate | Download (2.6 kB)

1 27738c43 Kostas Papadimitriou
# Copyright 2013 GRNET S.A. All rights reserved.
2 27738c43 Kostas Papadimitriou
#
3 27738c43 Kostas Papadimitriou
# Redistribution and use in source and binary forms, with or
4 27738c43 Kostas Papadimitriou
# without modification, are permitted provided that the following
5 27738c43 Kostas Papadimitriou
# conditions are met:
6 27738c43 Kostas Papadimitriou
#
7 27738c43 Kostas Papadimitriou
#   1. Redistributions of source code must retain the above
8 27738c43 Kostas Papadimitriou
#      copyright notice, this list of conditions and the following
9 27738c43 Kostas Papadimitriou
#      disclaimer.
10 27738c43 Kostas Papadimitriou
#
11 27738c43 Kostas Papadimitriou
#   2. Redistributions in binary form must reproduce the above
12 27738c43 Kostas Papadimitriou
#      copyright notice, this list of conditions and the following
13 27738c43 Kostas Papadimitriou
#      disclaimer in the documentation and/or other materials
14 27738c43 Kostas Papadimitriou
#      provided with the distribution.
15 27738c43 Kostas Papadimitriou
#
16 27738c43 Kostas Papadimitriou
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17 27738c43 Kostas Papadimitriou
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 27738c43 Kostas Papadimitriou
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 27738c43 Kostas Papadimitriou
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20 27738c43 Kostas Papadimitriou
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 27738c43 Kostas Papadimitriou
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 27738c43 Kostas Papadimitriou
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 27738c43 Kostas Papadimitriou
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24 27738c43 Kostas Papadimitriou
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 27738c43 Kostas Papadimitriou
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26 27738c43 Kostas Papadimitriou
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 27738c43 Kostas Papadimitriou
# POSSIBILITY OF SUCH DAMAGE.
28 27738c43 Kostas Papadimitriou
#
29 27738c43 Kostas Papadimitriou
# The views and conclusions contained in the software and
30 27738c43 Kostas Papadimitriou
# documentation are those of the authors and should not be
31 27738c43 Kostas Papadimitriou
# interpreted as representing official policies, either expressed
32 27738c43 Kostas Papadimitriou
# or implied, of GRNET S.A.
33 27738c43 Kostas Papadimitriou
#
34 27738c43 Kostas Papadimitriou
35 27738c43 Kostas Papadimitriou
import synnefo.cyclades_settings as cyclades
36 adcfcd8c Kostas Papadimitriou
from synnefo.cyclades_settings import cyclades_services, astakos_services
37 27738c43 Kostas Papadimitriou
38 27738c43 Kostas Papadimitriou
from synnefo.lib import join_urls
39 7a0c725d Kostas Papadimitriou
from synnefo.lib.services import get_public_endpoint as endpoint
40 adcfcd8c Kostas Papadimitriou
41 27738c43 Kostas Papadimitriou
from django.conf import settings
42 27738c43 Kostas Papadimitriou
43 adcfcd8c Kostas Papadimitriou
BASE_PATH = cyclades.BASE_PATH
44 adcfcd8c Kostas Papadimitriou
if not BASE_PATH.startswith("/"):
45 adcfcd8c Kostas Papadimitriou
    BASE_PATH = "/" + BASE_PATH
46 27738c43 Kostas Papadimitriou
47 7a0c725d Kostas Papadimitriou
GLANCE_URL = endpoint(cyclades_services, 'image', 'v1.0').rstrip('/')
48 7a0c725d Kostas Papadimitriou
COMPUTE_URL = endpoint(cyclades_services, 'compute', 'v2.0').rstrip('/')
49 7a0c725d Kostas Papadimitriou
USERDATA_URL = endpoint(cyclades_services, 'cyclades_userdata', '').rstrip('/')
50 7a0c725d Kostas Papadimitriou
ASTAKOS_UI_URL = endpoint(astakos_services, 'astakos_ui', '').rstrip('/')
51 7a0c725d Kostas Papadimitriou
52 27738c43 Kostas Papadimitriou
53 27738c43 Kostas Papadimitriou
if cyclades.PROXY_USER_SERVICES:
54 adcfcd8c Kostas Papadimitriou
    ACCOUNT_URL = join_urls('/', cyclades.BASE_ASTAKOS_PROXY_PATH,
55 adcfcd8c Kostas Papadimitriou
                            cyclades.ASTAKOS_ACCOUNTS_PREFIX, 'v1.0')
56 adcfcd8c Kostas Papadimitriou
else:
57 8af7f2d5 Kostas Papadimitriou
    ACCOUNT_URL = endpoint(astakos_services, 'account', 'v1.0')
58 27738c43 Kostas Papadimitriou
59 27738c43 Kostas Papadimitriou
60 adcfcd8c Kostas Papadimitriou
USER_CATALOG_URL = join_urls(ACCOUNT_URL, 'user_catalogs')
61 adcfcd8c Kostas Papadimitriou
FEEDBACK_URL = join_urls(ACCOUNT_URL, 'feedback')
62 7eb45083 Kostas Papadimitriou
63 adcfcd8c Kostas Papadimitriou
LOGIN_URL = join_urls(ASTAKOS_UI_URL, 'login')
64 adcfcd8c Kostas Papadimitriou
LOGOUT_REDIRECT = LOGIN_URL