Statistics
| Branch: | Tag: | Revision:

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

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 5ba38e8a Kostas Papadimitriou
import logging
36 27738c43 Kostas Papadimitriou
import synnefo.cyclades_settings as cyclades
37 5ba38e8a Kostas Papadimitriou
38 5ba38e8a Kostas Papadimitriou
from django.conf import settings
39 5ba38e8a Kostas Papadimitriou
from astakosclient import AstakosClient
40 5ba38e8a Kostas Papadimitriou
41 5ba38e8a Kostas Papadimitriou
from synnefo import cyclades_settings
42 27738c43 Kostas Papadimitriou
43 27738c43 Kostas Papadimitriou
from synnefo.lib import join_urls
44 7a0c725d Kostas Papadimitriou
from synnefo.lib.services import get_public_endpoint as endpoint
45 adcfcd8c Kostas Papadimitriou
46 27738c43 Kostas Papadimitriou
47 5ba38e8a Kostas Papadimitriou
logger = logging.getLogger(__name__)
48 5ba38e8a Kostas Papadimitriou
49 adcfcd8c Kostas Papadimitriou
BASE_PATH = cyclades.BASE_PATH
50 adcfcd8c Kostas Papadimitriou
if not BASE_PATH.startswith("/"):
51 adcfcd8c Kostas Papadimitriou
    BASE_PATH = "/" + BASE_PATH
52 27738c43 Kostas Papadimitriou
53 5ba38e8a Kostas Papadimitriou
cyclades_services = cyclades_settings.cyclades_services
54 5ba38e8a Kostas Papadimitriou
55 b872a653 Kostas Papadimitriou
VOLUME_URL = endpoint(cyclades_services, 'volume', 'v2.0').rstrip('/')
56 7a0c725d Kostas Papadimitriou
GLANCE_URL = endpoint(cyclades_services, 'image', 'v1.0').rstrip('/')
57 7a0c725d Kostas Papadimitriou
COMPUTE_URL = endpoint(cyclades_services, 'compute', 'v2.0').rstrip('/')
58 e481c282 Kostas Papadimitriou
NETWORK_URL = endpoint(cyclades_services, 'network', 'v2.0').rstrip('/')
59 7a0c725d Kostas Papadimitriou
USERDATA_URL = endpoint(cyclades_services, 'cyclades_userdata', '').rstrip('/')
60 27738c43 Kostas Papadimitriou
61 e407f159 Ilias Tsitsimpis
ACCOUNT_URL = join_urls('/', cyclades.ASTAKOS_ACCOUNT_PROXY_PATH)
62 27738c43 Kostas Papadimitriou
63 adcfcd8c Kostas Papadimitriou
USER_CATALOG_URL = join_urls(ACCOUNT_URL, 'user_catalogs')
64 adcfcd8c Kostas Papadimitriou
FEEDBACK_URL = join_urls(ACCOUNT_URL, 'feedback')
65 7eb45083 Kostas Papadimitriou
66 cb47b287 Kostas Papadimitriou
LOGIN_URL = join_urls('/', cyclades.ASTAKOS_UI_PROXY_PATH, 'login')
67 adcfcd8c Kostas Papadimitriou
LOGOUT_REDIRECT = LOGIN_URL