import os from common import * import dhcpd import named import rcnodelocal import resolv import snmpd import dns root = xml_to_obj_hierarchy("nodes.xml") ready_nodes_dtd_hierarchy(root) ensure_dir_exists("output") os.chdir("output") for node in root.nodes: ensure_dir_exists(node.name) os.chdir(node.name) open("dhcpd.conf", 'w').write(dhcpd.gen_dhcpd_conf(node)) open("named.conf", 'w').write(named.gen_named_conf(node)) open("rc.node.local", 'w').write(rcnodelocal.gen_rcnodelocal(node)) open("resolv.conf", 'w').write(resolv.gen_resolv_conf(node)) open("snmpd.local.conf", 'w').write(snmpd.gen_snmpd_local_conf(node)) open("pen.sh", 'w').write(penconf.gen_pen_sh(node)) os.chdir("..")