Calculate the *legacy* on-disk path to storing a zonefile's information, given the zonefile hash.
    If the zonefile hash is abcdef1234567890, then the path will be $zonefile_dir/ab/cd/ef/12/34/56/78/90/zonefile.txt

    This format is no longer used to create new zonefiles, since it takes a lot of inodes to store comparatively few zone files.

    Returns the legacy path

def atlas_zonefile_path_legacy( zonefile_dir, zonefile_hash ):
    """
    Calculate the *legacy* on-disk path to storing a zonefile's information, given the zonefile hash.
    If the zonefile hash is abcdef1234567890, then the path will be $zonefile_dir/ab/cd/ef/12/34/56/78/90/zonefile.txt

    This format is no longer used to create new zonefiles, since it takes a lot of inodes to store comparatively few zone files.

    Returns the legacy path
    """

    # split into directories, so we don't try to cram millions of files into one directory
    zonefile_dir_parts = []
    interval = 2
    for i in xrange(0, len(zonefile_hash), interval):
        zonefile_dir_parts.append( zonefile_hash[i:i+interval] )

    zonefile_dir_path = os.path.join(zonefile_dir, "/".join(zonefile_dir_parts))
    return os.path.join(zonefile_dir_path, "zonefile.txt")