lib/_provisioning/provision-config.js
function brokersForConfig (brokerLines) {
  return brokerLines.reduce(function (acc, brokerLine) {
    var brokerElements = brokerLine.split('=')
    if (brokerElements.length !== 2) {
      throw new DxlError('Invalid key value pair for broker entry: ' +
        brokerLine)
    }
    acc[brokerElements[0]] = brokerElements[1]
    return acc
  }, {})
}
function brokersForConfig (brokerLines) {
  return brokerLines.reduce(function (acc, brokerLine) {
    var brokerElements = brokerLine.split('=')
    if (brokerElements.length !== 2) {
      throw new DxlError('Invalid key value pair for broker entry: ' +
        brokerLine)
    }
    acc[brokerElements[0]] = brokerElements[1]
    return acc
  }, {})
}
function brokersForConfig ( brokerLines ) { return brokerLines . reduce ( function ( acc , brokerLine ) { var brokerElements = brokerLine . split ( '=' ) if ( brokerElements . length !== 2 ) { throw new DxlError ( 'Invalid key value pair for broker entry: ' + brokerLine ) } acc [ brokerElements [ 0 ] ] = brokerElements [ 1 ] return acc } , { } ) }
Converts the broker lines received from the management service into an
object which can be used for rewriting the full configuration ini file.
@param {Array<String>} brokerLines - List of broker lines.
@example For a value of "id1=id1;host1;8883;127.0.0.1\nid2=id2;host2;8883;127.0.0.2",
this function would return an object with keys named 'id1' and 'id2' with
corresponding values of 'id1;host1;8883;127.0.0.1' and
'id2;host2;8883;127.0.0.2'.
@returns {Object} Object representation of the broker lines.
@private
Converts the broker lines received from the management service into an object which can be used for rewriting the full configuration ini file .