Changeset 2758 for trunk/server/fedora
- Timestamp:
- Feb 26, 2016, 6:08:03 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/fedora/config/etc/httpd/vhosts.d/reify-vhost.py
r2731 r2758 1 1 #!/usr/bin/python 2 2 # 3 # Converts an apacheConfigrecord from LDAP, as used by mod_vhost_ldap,3 # Converts an scriptsVhost record from LDAP, as used by mod_vhost_ldap, 4 4 # into a <VirtualHost> record as used in an Apache conf.d directory. 5 5 # Useful for adding things like SSL server certs that mod_vhost_ldap … … 27 27 ldap.SCOPE_SUBTREE, 28 28 ldap.filter.filter_format( 29 "(&(objectClass= apacheConfig)" +30 "(|( apacheServerName=%s)" +31 "( apacheServerAlias=%s)))",29 "(&(objectClass=scriptsVhost)" + 30 "(|(scriptsVhostName=%s)" + 31 "(scriptsVhostAlias=%s)))", 32 32 [host, host])) 33 33 if len(r) != 0: 34 34 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']) 37 37 print """\ 38 38 <IfModule ssl_module> … … 55 55 </VirtualHost> 56 56 </IfModule>""" % { 57 'servername': r[0][1][' apacheServerName'][0],57 'servername': r[0][1]['scriptsVhostName'][0], 58 58 'serveralias': serveralias, 59 59 'hname': host
Note: See TracChangeset
for help on using the changeset viewer.