Changeset 10730 in genesis for tools


Ignore:
Timestamp:
May 8, 2012, 10:13:26 PM (13 years ago)
Author:
rick
Message:

DNS name for external configured addresses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10729 r10730  
    10311031    if datadump['nodetype'] in ['CNode', 'Hybrid']:
    10321032      wleiden_cname[datadump['nodename']] = fqdn
     1033 
     1034    if datadump.has_key('rdr_host'):
     1035      remote_target = datadump['rdr_host']
     1036    elif datadump.has_key('remote_access') and datadump['remote_access']:
     1037      remote_target = datadump['remote_access'].split(':')[0]
     1038    else:
     1039      remote_target = None
     1040
     1041    if remote_target:
     1042      try:
     1043        parseaddr(remote_target)
     1044        wleiden_zone[datadump['nodename'] + '.gw'].append((remote_target, False))
     1045      except (IndexError, ValueError):
     1046        wleiden_cname[datadump['nodename'] + '.gw'] = remote_target + '.'
     1047
    10331048
    10341049    wleiden_zone[fqdn].append((datadump['masterip'], True))
     
    11751190  for host,items in wleiden_zone.iteritems():
    11761191    for ip,reverse in items:
    1177       if valid_addr(ip):
     1192      if ip not in ['0.0.0.0']:
    11781193        f.write("%s.wleiden.net. IN A %s \n" % (host.lower(), ip))
    11791194  for source,dest in wleiden_cname.iteritems():
    1180     f.write("%s.wleiden.net. IN CNAME %s.wleiden.net.\n" % (source.lower(), dest.lower()))
     1195    dest = dest if dest.endswith('.') else dest + ".wleiden.net."
     1196    f.write("%s.wleiden.net. IN CNAME %s\n" % (source.lower(), dest.lower()))
    11811197  for source, dest in wleiden_raw.iteritems():
    11821198    f.write("%s.wleiden.net. %s\n" % (source, dest))
Note: See TracChangeset for help on using the changeset viewer.