Commit b99b4167 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

pithos: Include additional prefixes settings

- Include settings for astakos accounts/views/keystone prefixes
- Renamed ASTAKOS_ACCOUNT_PREFIX -> ASTAKOS_ACCOUNTS_PREFIX
- Prepend BASE_ASTAKOS_PROXY_PATH with BASE_PATH by default
parent 50ddae69
#coding=utf8
from django.conf import settings
from synnefo.lib import parse_base_url
from synnefo.lib import parse_base_url, join_urls
from astakosclient import astakos_services
from synnefo.lib.services import fill_endpoints
from synnefo.util.keypath import get_path
......@@ -30,10 +30,14 @@ CUSTOMIZE_ASTAKOS_SERVICES = \
for path, value in CUSTOMIZE_ASTAKOS_SERVICES:
set_path(astakos_services, path, value, createpath=True)
ASTAKOS_ACCOUNT_PREFIX = get_path(astakos_services, 'astakos_account.prefix')
ASTAKOS_ACCOUNTS_PREFIX = get_path(astakos_services, 'astakos_account.prefix')
ASTAKOS_VIEWS_PREFIX = get_path(astakos_services, 'astakos_ui.prefix')
ASTAKOS_KEYSTONE_PREFIX = get_path(astakos_services, 'astakos_keystone.prefix')
BASE_ASTAKOS_PROXY_PATH = getattr(settings, 'PITHOS_BASE_ASTAKOS_PROXY_PATH',
ASTAKOS_BASE_PATH)
BASE_ASTAKOS_PROXY_PATH = join_urls(BASE_PATH, BASE_ASTAKOS_PROXY_PATH)
BASE_ASTAKOS_PROXY_PATH = BASE_ASTAKOS_PROXY_PATH.strip('/')
ASTAKOSCLIENT_POOLSIZE = getattr(settings, 'PITHOS_ASTAKOSCLIENT_POOLSIZE', 200)
......
......@@ -37,7 +37,7 @@ from snf_django.lib.api.proxy import proxy
from snf_django.lib.api.utils import prefix_pattern
from pithos.api.settings import (
BASE_PATH, ASTAKOS_BASE_URL, BASE_ASTAKOS_PROXY_PATH,
ASTAKOS_ACCOUNT_PREFIX, PROXY_USER_SERVICES,
ASTAKOS_ACCOUNTS_PREFIX, PROXY_USER_SERVICES,
PITHOS_PREFIX, PUBLIC_PREFIX, UI_PREFIX)
from urlparse import urlparse
......@@ -73,7 +73,7 @@ if PROXY_USER_SERVICES:
(r'^login/?$', astakos_proxy),
(r'^feedback/?$', astakos_proxy),
(r'^user_catalogs/?$', astakos_proxy),
(prefix_pattern(ASTAKOS_ACCOUNT_PREFIX), astakos_proxy),
(prefix_pattern(ASTAKOS_ACCOUNTS_PREFIX), astakos_proxy),
)
urlpatterns += patterns(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment