Changeset 10934 in genesis


Ignore:
Timestamp:
May 20, 2012, 1:10:59 AM (13 years ago)
Author:
rick
Message:

Make the nameserver a seperate call as we need it later on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10932 r10934  
    824824
    825825
     826nameservers_cache = {}
     827def get_nameservers():
     828  if nameservers_cache:
     829    return nameservers_cache
     830
     831  for host in get_proxylist() + get_hybridlist():
     832    hostdump = get_yaml(host)
     833    nameservers_cache[hostdump['masterip']] = hostdump['autogen_realname']
     834
     835  return nameservers_cache
     836
     837
    826838def generate_resolv_conf(datadump):
    827839  """ Generate configuration file '/etc/resolv.conf' """
     
    829841  datadump['autogen_header'] = generate_header(datadump, "#")
    830842  datadump['autogen_edge_nameservers'] = ''
    831   for host in get_proxylist():
    832     hostdump = get_yaml(host)
    833     datadump['autogen_edge_nameservers'] += "nameserver %(masterip)-15s # %(autogen_realname)s\n" % hostdump
    834   for host in get_hybridlist():
    835     hostdump = get_yaml(host)
    836     if hostdump['service_proxy_ileiden'] or hostdump['service_proxy_normal']:
    837       datadump['autogen_edge_nameservers'] += "nameserver %(masterip)-15s # %(autogen_realname)s\n" % hostdump
     843
     844
     845  for masterip,realname in get_nameservers().iteritems():
     846    datadump['autogen_edge_nameservers'] += "nameserver %-15s # %s\n" % (masterip, realname)
    838847
    839848  return Template("""\
Note: See TracChangeset for help on using the changeset viewer.