From 4ec540fd3fdd6e8d509581ccf10e7a1644e7f27b Mon Sep 17 00:00:00 2001 From: Ken Raffenetti Date: Mon, 26 Feb 2007 20:32:40 +0000 Subject: fix for use with more than 2 hosts git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2883 ce84e21b-d406-0410-9b95-82705330c041 --- tools/batchadd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/batchadd.py b/tools/batchadd.py index 751633ea5..ce47650a5 100755 --- a/tools/batchadd.py +++ b/tools/batchadd.py @@ -22,10 +22,11 @@ def checkformat(values, indices): """Ensures file contains all necessary attributes in order """ filelist = [pair[0] for pair in values] -# lines = len(filelist) + # lines = len(filelist) + + filelist = filelist[indices[0]:] for index in indices: - filelist = filelist[index:] if filelist[0:13] != host_attribs: # figure out what to do here return False @@ -34,6 +35,7 @@ def checkformat(values, indices): try: next = filelist[1:].index('hostname') remaining = filelist[13:next+1] + filelist = filelist[next+1:] except: remaining = filelist[13:] needfields = ['mac_addr', 'hdwr_type', 'ip_addr'] -- cgit v1.2.3-1-g7c22