Lines 85-99
def _handler(ucr, changes):
|
Link Here
|
---|
|
85 |
return |
85 |
return |
86 |
lo, pos = get_machine_connection() |
86 |
lo, pos = get_machine_connection() |
87 |
pos.setDn('cn=portal,cn=univention,%s' % ucr.get('ldap/base')) |
87 |
pos.setDn('cn=portal,cn=univention,%s' % ucr.get('ldap/base')) |
88 |
interfaces = Interfaces(ucr) |
|
|
89 |
hostname = '%s.%s' % (ucr.get('hostname'), ucr.get('domainname')) |
88 |
hostname = '%s.%s' % (ucr.get('hostname'), ucr.get('domainname')) |
90 |
default_ipv4_address = interfaces.get_default_ipv4_address() |
89 |
|
91 |
if default_ipv4_address: |
90 |
# iterate over all ipv4 and ipv6 addresses and append them to the link |
92 |
default_ipv4_address = str(default_ipv4_address.ip) |
91 |
local_hosts = [hostname] |
93 |
default_ipv6_address = interfaces.get_default_ipv6_address() |
92 |
interfaces = Interfaces(ucr) |
94 |
if default_ipv6_address: |
93 |
for idev, iconf in interfaces.all_interfaces: |
95 |
default_ipv6_address = str(default_ipv6_address.ip) |
94 |
# get ipv4 address of device |
96 |
local_hosts = [hostname, default_ipv4_address, default_ipv6_address] |
95 |
if iconf.get('address'): |
|
|
96 |
local_hosts.append(iconf['address']) |
97 |
|
98 |
# get ipv6 addresses of device |
99 |
for ikey, ival in iconf.iteritems(): |
100 |
if ikey.startswith('ipv6/') and ikey.endswith('/address'): |
101 |
local_hosts.append('[%s]' % (iconf[ikey], )) |
102 |
|
97 |
portal_logger.debug('Local hosts are: %r' % local_hosts) |
103 |
portal_logger.debug('Local hosts are: %r' % local_hosts) |
98 |
attr_entries = {} |
104 |
attr_entries = {} |
99 |
for changed_entry in changed_entries: |
105 |
for changed_entry in changed_entries: |