def openstack(request):
    context = {}

    # Auth/Keystone context
    context.setdefault('authorized_tenants', [])
    if request.user.is_authenticated():
        context['authorized_tenants'] = [
            tenant for tenant in
            request.user.authorized_tenants if tenant.enabled]

    # Region context/support
    available_regions = getattr(settings, 'AVAILABLE_REGIONS', [])
    regions = {'support': len(available_regions) > 1,
               'current': {'endpoint': request.session.get('region_endpoint'),
                           'name': request.session.get('region_name')},
               'available': [{'endpoint': region[0], 'name':region[1]} for
                             region in available_regions]}
    context['regions'] = regions

    # Adding webroot access
    context['WEBROOT'] = getattr(settings, "WEBROOT", "/")

    # Search for external plugins and append to javascript message catalog
    # internal plugins are under the openstack_dashboard domain
    # so we exclude them from the js_catalog
    js_catalog = ['horizon', 'openstack_dashboard']
    regex = re.compile(r'^openstack_dashboard')
    all_plugins = conf.HORIZON_CONFIG['plugins']
    js_catalog.extend(p for p in all_plugins if not regex.search(p))
    context['JS_CATALOG'] = '+'.join(js_catalog)

    return context
Modify DNS information on the primary interface.
dataset/ETHPy150Open openstack/horizon/openstack_dashboard/context_processors.py/openstack--crossover with--dataset/ETHPy150Open chromium/web-page-replay/platformsettings.py/_WindowsPlatformSettings._netsh_set_dns_dhcp