lib/utils/job-utils/catalog-searcher.js
function findDriveWwidByIndex(catalog, isEsx, driveIndex) {
        var wwid = null;
        _.forEach(catalog, function(entry) {
            if (entry.identifier === driveIndex) {
                wwid = isEsx ? entry.esxiWwid : entry.linuxWwid;
                return false; //have found the result, so we can exit iteration early.
            }
        });
        return wwid;
    }
function findDriveWwidByIndex(catalog, isEsx, driveIndex) {
        var wwid = null;
        _.forEach(catalog, function(entry) {
            if (entry.identifier === driveIndex) {
                wwid = isEsx ? entry.esxiWwid : entry.linuxWwid;
                return false; //have found the result, so we can exit iteration early.
            }
        });
        return wwid;
    }
function findDriveWwidByIndex ( catalog , isEsx , driveIndex ) { var wwid = null ; _ . forEach ( catalog , function ( entry ) { if ( entry . identifier === driveIndex ) { wwid = isEsx ? entry . esxiWwid : entry . linuxWwid ; return false ; //have found the result, so we can exit iteration early. } } ) ; return wwid ; }
Search the driveid catalog and lookup the corresponding drive WWID by the input
drive index.
@param {Object} catalog - the catalog data of drive id
@param {Boolean} isEsx - True to return the ESXi formated wwid,
otherwise linux format wwid.
@param {Number} driveIndex - The drive index
@return {String} The WWID for the target drive. If failed, return null
Search the driveid catalog and lookup the corresponding drive WWID by the input drive index .