analyze the data from osimage

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9079 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2011-03-18 03:31:21 +00:00
parent 5c35251106
commit acbd43ef20

View File

@ -2036,15 +2036,42 @@ function setOSImageCookies(data) {
var profilesHash = new Object();
var osVersHash = new Object();
var osArchsHash = new Object();
var imagePos = 0;
var profilePos = 0;
var osversPos = 0;
var osarchPos = 0;
//get the column value
var colNameArray = rsp[0].substr(1).split(',');
for (var i in colNameArray){
switch (colNameArray[i]){
case 'imagename': {
imagePos = i;
}
break;
case 'profile':{
profilePos = i;
}
break;
case 'osvers':{
osversPos = i;
}
break;
case 'osarch':{
osarchPos = i;
}
break;
default :
break;
}
}
// Go through each index
for (var i = 1; i < rsp.length; i++) {
// Get image name
var cols = rsp[i].split(',');
var osImage = cols[0].replace(new RegExp('"', 'g'), '');
var profile = cols[1].replace(new RegExp('"', 'g'), '');
var osVer = cols[6].replace(new RegExp('"', 'g'), '');
var osArch = cols[8].replace(new RegExp('"', 'g'), '');
var osImage = cols[imagePos].replace(new RegExp('"', 'g'), '');
var profile = cols[profilePos].replace(new RegExp('"', 'g'), '');
var osVer = cols[osversPos].replace(new RegExp('"', 'g'), '');
var osArch = cols[osarchPos].replace(new RegExp('"', 'g'), '');
imageNames.push(osImage);
profilesHash[profile] = 1;