Ignore:
Timestamp:
Feb 26, 2016, 6:08:03 AM (9 years ago)
Author:
andersk
Message:
reify-vhost.py: Use scriptsVhost records rather than apacheConfig records
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/fedora/config/etc/httpd/vhosts.d/reify-vhost.py

    r2731 r2758  
    11#!/usr/bin/python
    22#
    3 # Converts an apacheConfig record from LDAP, as used by mod_vhost_ldap,
     3# Converts an scriptsVhost record from LDAP, as used by mod_vhost_ldap,
    44# into a <VirtualHost> record as used in an Apache conf.d directory.
    55# Useful for adding things like SSL server certs that mod_vhost_ldap
     
    2727    ldap.SCOPE_SUBTREE,
    2828    ldap.filter.filter_format(
    29             "(&(objectClass=apacheConfig)" +
    30             "(|(apacheServerName=%s)" +
    31             "(apacheServerAlias=%s)))",
     29            "(&(objectClass=scriptsVhost)" +
     30            "(|(scriptsVhostName=%s)" +
     31            "(scriptsVhostAlias=%s)))",
    3232           [host, host]))
    3333if len(r) != 0:
    3434    serveralias = ""
    35     if 'apacheServerAlias' in r[0][1]:
    36         serveralias = "ServerAlias "+" ".join(r[0][1]['apacheServerAlias'])
     35    if 'scriptsVhostAlias' in r[0][1]:
     36        serveralias = "ServerAlias "+" ".join(r[0][1]['scriptsVhostAlias'])
    3737    print """\
    3838<IfModule ssl_module>
     
    5555        </VirtualHost>
    5656</IfModule>""" % {
    57     'servername': r[0][1]['apacheServerName'][0],
     57    'servername': r[0][1]['scriptsVhostName'][0],
    5858    'serveralias': serveralias,
    5959    'hname': host
Note: See TracChangeset for help on using the changeset viewer.