modified to ensure compatibility with python2.6

235: line = "{}.{}\n".format(path, metric) is python 2.7 syntax