# or implied, of GRNET S.A. from django.conf import settings from synnefo_branding import settings as synnefo_settings from synnefo.lib import parse_base_url from astakos.api.services import astakos_services as vanilla_astakos_services from synnefo.util.keypath import get_path from synnefo.lib import join_urls from synnefo.lib.services import fill_endpoints from copy import deepcopy BASE_URL = getattr(settings, 'ASTAKOS_BASE_URL', 'https://accounts.example.synnefo.org') 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') # Set the expiration time of newly created auth tokens # to be this many hours after their creation time. AUTH_TOKEN_DURATION = getattr(settings, 'ASTAKOS_AUTH_TOKEN_DURATION', 30 * 24) DEFAULT_USER_LEVEL = getattr(settings, 'ASTAKOS_DEFAULT_USER_LEVEL', 4)
from django.conf import settings from synnefo.lib import join_urls, parse_base_url 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 astakos_services as vanilla_astakos_services from copy import deepcopy # Process Cyclades settings BASE_URL = getattr(settings, 'CYCLADES_BASE_URL', 'https://compute.example.synnefo.org/compute/') BASE_HOST, BASE_PATH = parse_base_url(BASE_URL) 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, path, value, createpath=True) COMPUTE_PREFIX = get_path(cyclades_services, 'cyclades_compute.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')
from copy import deepcopy logger = logging.getLogger(__name__) # -------------------------------------------------------------------- # Process Pithos settings # Top-level URL for Pithos. Must set. BASE_URL = getattr(settings, 'PITHOS_BASE_URL', "https://object-store.example.synnefo.org/pithos/") # Service Token acquired by identity provider. SERVICE_TOKEN = getattr(settings, 'PITHOS_SERVICE_TOKEN', '') BASE_HOST, BASE_PATH = parse_base_url(BASE_URL) pithos_services = deepcopy(vanilla_pithos_services) fill_endpoints(pithos_services, BASE_URL) PITHOS_PREFIX = pithos_services['pithos_object-store']['prefix'] PUBLIC_PREFIX = pithos_services['pithos_public']['prefix'] UI_PREFIX = pithos_services['pithos_ui']['prefix'] VIEW_PREFIX = join_urls(UI_PREFIX, 'view') # -------------------------------------------------------------------- # Process Astakos settings ASTAKOS_AUTH_URL = getattr( settings, 'ASTAKOS_AUTH_URL', 'https://accounts.example.synnefo.org/astakos/identity/v2.0')
#coding=utf8 from django.conf import settings from synnefo.lib import parse_base_url, join_urls from synnefo.lib.services import fill_endpoints, get_public_endpoint from synnefo.util.keypath import get_path, set_path from pithos.api.services import pithos_services as vanilla_pithos_services from astakosclient import astakos_services as vanilla_astakos_services from copy import deepcopy # Top-level URL for Pithos. Must set. BASE_URL = getattr(settings, 'PITHOS_BASE_URL', "https://object-store.example.synnefo.org/pithos/") BASE_HOST, BASE_PATH = parse_base_url(BASE_URL) # Process Astakos settings ASTAKOS_BASE_URL = getattr(settings, 'ASTAKOS_BASE_URL', 'https://accounts.example.synnefo.org/astakos/') ASTAKOS_BASE_HOST, ASTAKOS_BASE_PATH = parse_base_url(ASTAKOS_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') astakos_services = deepcopy(vanilla_astakos_services) fill_endpoints(astakos_services, ASTAKOS_BASE_URL) CUSTOMIZE_ASTAKOS_SERVICES = \ getattr(settings, 'PITHOS_CUSTOMIZE_ASTAKOS_SERVICES', ())