def print_definitions(d, base_url): fill_endpoints(d, base_url) print json.dumps(filter_public(d), indent=4)
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') ASTAKOSCLIENT_POOLSIZE = \ getattr(settings, 'PITHOS_ASTAKOSCLIENT_POOLSIZE', 200)
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) INVITATIONS_PER_LEVEL = getattr(settings, 'ASTAKOS_INVITATIONS_PER_LEVEL', { 0: 100, 1: 2,
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') COMPUTE_ROOT_URL = join_urls(BASE_URL, COMPUTE_PREFIX) # Process Astakos settings
from astakosclient 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') # 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) INVITATIONS_PER_LEVEL = getattr(settings, 'ASTAKOS_INVITATIONS_PER_LEVEL', { 0: 100, 1: 2, 2: 0,
from copy import deepcopy logger = logging.getLogger(__name__) # -------------------------------------------------------------------- # 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) SERVICE_TOKEN = getattr(settings, 'CYCLADES_SERVICE_TOKEN', "") 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') 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)
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', ()) for path, value in CUSTOMIZE_ASTAKOS_SERVICES: set_path(astakos_services, path, value, createpath=True) 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_identity.prefix')
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') COMPUTE_ROOT_URL = join_urls(BASE_URL, COMPUTE_PREFIX) # Process Astakos settings