#!/usr/bin/env python

letters = '0123456789abcdef'

nodes = []
nodesFile = open('/home/panstarrs/schastel/local/share/ippMhpccStorageNodes')
for line in nodesFile:
    nodes.append(line[:-1])
nodesFile.close()

template = ""
templateFile = open('sql/CreateTablesTemplate.sql')
for line in templateFile:
    template = "%s%s" % (template, line)
templateFile.close()

for letter1 in letters:
    for letter2 in letters:
        directory = '%s%s' % (letter1, letter2)
        for node in nodes:
            print template.replace('@HOST@', 
                                   node).replace('@DIRECTORY@', 
                                                 directory)
