Make zone reloads work when ud-generate updates zone files
[mirror/userdir-ldap.git] / ud-generate
index f5279e0..549c744 100755 (executable)
@@ -986,7 +986,10 @@ def GenSSHKnown(File, mode=None):
      
          for I in x[1]["sshRSAHostKey"]:
             if mode and mode == 'authorized_keys':
-               Line = 'command="rsync --server --sender -pr . /var/cache/userdir-ldap/hosts/%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="%s" %s' % (Host, ",".join(HostToIP(x)), I)
+               hosts = HostToIP(x)
+               if 'sshdistAuthKeysHost' in x[1]:
+                  hosts += x[1]['sshdistAuthKeysHost']
+               Line = 'command="rsync --server --sender -pr . /var/cache/userdir-ldap/hosts/%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="%s" %s' % (Host, ",".join(hosts), I)
                #Line = 'command="rsync --server --sender -pr . /var/cache/userdir-ldap/hosts/%s",no-port-forwarding,no-X11-forwarding,no-agent-forwarding %s' % (Host,I)
             else:
                Line = "%s %s" %(",".join(HostNames + HostToIP(x, False)), I)
@@ -1015,6 +1018,9 @@ def GenHosts(File):
          if IsDebianHost.match(GetAttr(x, "hostname")) is None:
             continue
 
+         if not 'ipHostNumber' in x[1]:
+            continue
+
          addrs = x[1]["ipHostNumber"]
          for addr in addrs:
             if addr not in seen: