summaryrefslogtreecommitdiffstats
path: root/tools/batchadd.py
diff options
context:
space:
mode:
authorKen Raffenetti <raffenet@mcs.anl.gov>2007-02-26 20:32:40 +0000
committerKen Raffenetti <raffenet@mcs.anl.gov>2007-02-26 20:32:40 +0000
commit4ec540fd3fdd6e8d509581ccf10e7a1644e7f27b (patch)
tree2993a0b8a3dd020ce16f9fc16a8ab8d0074af4c2 /tools/batchadd.py
parent7c77da661dd36bc14bbad3aabbca89b0e0b6f299 (diff)
downloadbcfg2-4ec540fd3fdd6e8d509581ccf10e7a1644e7f27b.tar.gz
bcfg2-4ec540fd3fdd6e8d509581ccf10e7a1644e7f27b.tar.bz2
bcfg2-4ec540fd3fdd6e8d509581ccf10e7a1644e7f27b.zip
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
Diffstat (limited to 'tools/batchadd.py')
-rwxr-xr-xtools/batchadd.py6
1 files 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']