Commit cd3d6b1b authored by Giorgos Korfiatis's avatar Giorgos Korfiatis

Revert "common: Do not encode key paths as string"

This reverts commit b10f66b9a20fb9dca0a56c88d5d224f1e3fa25ea.
parent 6685ff8d
......@@ -34,5 +34,4 @@
from astakos.im.settings import astakos_services
from synnefo.util.keypath import get_path
resources = get_path(
astakos_services, ['astakos_account', 'resources']).values()
resources = get_path(astakos_services, 'astakos_account.resources').values()
......@@ -50,11 +50,11 @@ BASE_HOST, BASE_PATH = parse_base_url(BASE_URL)
astakos_services = deepcopy(vanilla_astakos_services)
fill_endpoints(astakos_services, BASE_URL)
ACCOUNTS_PREFIX = get_path(astakos_services, ['astakos_account', 'prefix'])
VIEWS_PREFIX = get_path(astakos_services, ['astakos_ui', 'prefix'])
KEYSTONE_PREFIX = get_path(astakos_services, ['astakos_identity', 'prefix'])
WEBLOGIN_PREFIX = get_path(astakos_services, ['astakos_weblogin', 'prefix'])
ADMIN_PREFIX = get_path(astakos_services, ['astakos_admin', 'prefix'])
ACCOUNTS_PREFIX = get_path(astakos_services, 'astakos_account.prefix')
VIEWS_PREFIX = get_path(astakos_services, 'astakos_ui.prefix')
KEYSTONE_PREFIX = get_path(astakos_services, 'astakos_identity.prefix')
WEBLOGIN_PREFIX = get_path(astakos_services, 'astakos_weblogin.prefix')
ADMIN_PREFIX = get_path(astakos_services, 'astakos_admin.prefix')
# Set the expiration time of newly created auth tokens
# to be this many hours after their creation time.
......
......@@ -39,16 +39,16 @@ from urlparse import urlparse
def fill_endpoints(services, base_url):
for name, service in services.iteritems():
prefix = get_path(service, ['prefix'])
endpoints = get_path(service, ['endpoints'])
prefix = get_path(service, 'prefix')
endpoints = get_path(service, 'endpoints')
for endpoint in endpoints:
version = get_path(endpoint, ['versionId'])
publicURL = get_path(endpoint, ['publicURL'])
version = get_path(endpoint, 'versionId')
publicURL = get_path(endpoint, 'publicURL')
if publicURL is not None:
continue
publicURL = join_urls(base_url, prefix, version).rstrip('/')
set_path(endpoint, ['publicURL'], publicURL)
set_path(endpoint, 'publicURL', publicURL)
def filter_public(services):
......
This diff is collapsed.
......@@ -35,7 +35,7 @@ import logging
from django.conf import settings
from synnefo.lib import join_urls, parse_base_url
from synnefo.util.keypath import get_path, set_path, unpack
from synnefo.util.keypath import get_path, set_path
from synnefo.api.services import cyclades_services as vanilla_cyclades_services
from synnefo.lib.services import fill_endpoints
from astakosclient import AstakosClient
......@@ -57,16 +57,16 @@ CUSTOMIZE_SERVICES = getattr(settings, 'CYCLADES_CUSTOMIZE_SERVICES', ())
cyclades_services = deepcopy(vanilla_cyclades_services)
fill_endpoints(cyclades_services, BASE_URL)
for path, value in CUSTOMIZE_SERVICES:
set_path(cyclades_services, unpack(path), value, createpath=True)
COMPUTE_PREFIX = get_path(cyclades_services, ['cyclades_compute', 'prefix'])
NETWORK_PREFIX = get_path(cyclades_services, ['cyclades_network', 'prefix'])
VMAPI_PREFIX = get_path(cyclades_services, ['cyclades_vmapi', 'prefix'])
PLANKTON_PREFIX = get_path(cyclades_services, ['cyclades_plankton', 'prefix'])
HELPDESK_PREFIX = get_path(cyclades_services, ['cyclades_helpdesk', 'prefix'])
UI_PREFIX = get_path(cyclades_services, ['cyclades_ui', 'prefix'])
USERDATA_PREFIX = get_path(cyclades_services, ['cyclades_userdata', 'prefix'])
ADMIN_PREFIX = get_path(cyclades_services, ['cyclades_admin', 'prefix'])
set_path(cyclades_services, path, value, createpath=True)
COMPUTE_PREFIX = get_path(cyclades_services, 'cyclades_compute.prefix')
NETWORK_PREFIX = get_path(cyclades_services, 'cyclades_network.prefix')
VMAPI_PREFIX = get_path(cyclades_services, 'cyclades_vmapi.prefix')
PLANKTON_PREFIX = get_path(cyclades_services, 'cyclades_plankton.prefix')
HELPDESK_PREFIX = get_path(cyclades_services, 'cyclades_helpdesk.prefix')
UI_PREFIX = get_path(cyclades_services, 'cyclades_ui.prefix')
USERDATA_PREFIX = get_path(cyclades_services, 'cyclades_userdata.prefix')
ADMIN_PREFIX = get_path(cyclades_services, 'cyclades_admin.prefix')
COMPUTE_ROOT_URL = join_urls(BASE_URL, COMPUTE_PREFIX)
......
......@@ -35,5 +35,5 @@ from synnefo.util.keypath import get_path
from synnefo.api.services import cyclades_services
resources = \
get_path(cyclades_services, ['cyclades_compute', 'resources']).values() +\
get_path(cyclades_services, ['cyclades_network', 'resources']).values()
get_path(cyclades_services, 'cyclades_compute.resources').values() +\
get_path(cyclades_services, 'cyclades_network.resources').values()
......@@ -34,5 +34,4 @@
from synnefo.util.keypath import get_path
from pithos.api.settings import pithos_services
resources = get_path(pithos_services,
['pithos_object-store', 'resources']).values()
resources = get_path(pithos_services, 'pithos_object-store.resources').values()
......@@ -59,9 +59,9 @@ BASE_HOST, BASE_PATH = parse_base_url(BASE_URL)
pithos_services = deepcopy(vanilla_pithos_services)
fill_endpoints(pithos_services, BASE_URL)
PITHOS_PREFIX = get_path(pithos_services, ['pithos_object-store', 'prefix'])
PUBLIC_PREFIX = get_path(pithos_services, ['pithos_public', 'prefix'])
UI_PREFIX = get_path(pithos_services, ['pithos_ui', 'prefix'])
PITHOS_PREFIX = get_path(pithos_services, 'pithos_object-store.prefix')
PUBLIC_PREFIX = get_path(pithos_services, 'pithos_public.prefix')
UI_PREFIX = get_path(pithos_services, 'pithos_ui.prefix')
VIEW_PREFIX = join_urls(UI_PREFIX, 'view')
......
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