Changeset 10919 in genesis for tools


Ignore:
Timestamp:
May 19, 2012, 5:00:51 PM (13 years ago)
Author:
rick
Message:

Ik ben die lange en verwarrende pool dns namen meer dan zat, zoals:

2pool-unigor-unigorn.cnodeunigor1.wleiden.net

Aangezien er een enkele ethernet backbone per locatie (tussen alle nodes dmv
van een switch) is het handiger wat korte naam te geven:

2ring.cnodeunigor1.wleiden.net

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10907 r10919  
    12081208
    12091209
    1210   def pool_to_name(fqdn, pool_members):
    1211     """Convert the joined name to a usable pool name"""
    1212 
    1213     def isplit(item):
    1214       (prefix, name, number) = re.match('^(cnode|hybrid|proxy)([a-z]+)([0-9]*)$',item.lower()).group(1,2,3)
    1215       return (prefix, name, number)
    1216    
    1217     my_name = isplit(fqdn.split('.')[0])[1]
    1218 
    1219     short_names = defaultdict(list)
    1220     for node in sorted(pool_members):
    1221       (prefix, name, number) = isplit(node)
    1222       short_names[name].append((prefix,number))
    1223 
    1224     return '-'.join(sorted(short_names.keys()))
    1225 
    12261210
    12271211  #  WL uses an /29 to configure an interface. IP's are ordered like this:
     
    12631247      for item in value:
    12641248        (iface_name, fqdn, ip) = item
    1265         pool_name = "2pool-" + pool_to_name(fqdn,pool_members)
    1266         wleiden_zone["%s.%s" % (pool_name, fqdn)].append((ip, True))
     1249        wleiden_zone["2ring.%s" % (fqdn)].append((ip, True))
    12671250
    12681251  # Include static DNS entries
Note: See TracChangeset for help on using the changeset viewer.