lib/utils/job-utils/command-parser.js
function _parseSmartErrorLog(lines) {
        var resultObj = {};

        //Parse first line to get revision number
        //Example data:
        //SMART Error Log Version: 1
        if (lines.length > 0) {
            resultObj.Revision = (lines[0].substring(
                lines[0].lastIndexOf(' ') + 1)).trim();
        }

        //TODO: need to implement the error log parser

        resultObj['Error Log Table'] = [];
        if (lines.length > 1 && lines[1].startsWith('No ')) {
            return resultObj;
        }
        //resultObj['Error Log Table'] = _parseSmartTable(lines, 1);

        return resultObj;
    }
function _parseSmartErrorLog(lines) {
        var resultObj = {};

        //Parse first line to get revision number
        //Example data:
        //SMART Error Log Version: 1
        if (lines.length > 0) {
            resultObj.Revision = (lines[0].substring(
                lines[0].lastIndexOf(' ') + 1)).trim();
        }

        //TODO: need to implement the error log parser

        resultObj['Error Log Table'] = [];
        if (lines.length > 1 && lines[1].startsWith('No ')) {
            return resultObj;
        }
        //resultObj['Error Log Table'] = _parseSmartTable(lines, 1);

        return resultObj;
    }
function _parseSmartErrorLog ( lines ) { var resultObj = { } ; //Parse first line to get revision number //Example data: //SMART Error Log Version: 1 if ( lines . length > 0 ) { resultObj . Revision = ( lines [ 0 ] . substring ( lines [ 0 ] . lastIndexOf ( ' ' ) + 1 ) ) . trim ( ) ; } //TODO: need to implement the error log parser resultObj [ 'Error Log Table' ] = [ ] ; if ( lines . length > 1 && lines [ 1 ] . startsWith ( 'No ' ) ) { return resultObj ; } //resultObj['Error Log Table'] = _parseSmartTable(lines, 1); return resultObj ; }
Parse SMART error log

@param {Array} The data to parse, it has been splitted by line.
@return {Object} The object with error log revision and table.
Parse SMART error log