-Fix problem with the noderes sample

-Provide sane error when a csv has unrecognized columns, TODO: option to drop unrecognized column on restore


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2598 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-01-14 14:41:38 +00:00
parent d549325b97
commit b2debb322d
2 changed files with 5 additions and 1 deletions

View File

@ -266,6 +266,10 @@ sub tabrestore
}
$tab->delEntries(); #Yes, delete *all* entries
my $header = shift @{$request->{data}};
unless ($header =~ /^#/) {
$cb->({error => "Data missing header line starting with #",errorcode=>1});
return;
}
$header =~ s/"//g; #Strip " from overzealous CSV apps
$header =~ s/^#//;
$header =~ s/\s+$//;

View File

@ -1,2 +1,2 @@
#node,servicenode,netboot,tftpserver,nfsserver,kernel,initrd,kcmdline,nfsdir,serialport,installnic,primarynic,xcatmaster,current_osimage,next_osimage,comments,disable
#node,servicenode,netboot,tftpserver,nfsserver,nfsdir,installnic,primarynic,xcatmaster,current_osimage,next_osimage,comments,disable
"compute",,pxe,,

Can't render this file because it has a wrong number of fields in line 2.