/** * Add the batch item for the nic in opts.nic opts.batch, as well as an * item for unsetting other primaries owned by the same owner, if required. */ function nicBatch(opts, callback) { assert.object(opts, 'opts'); assert.func(callback, 'callback'); opts.log.debug({ vnetCns: opts.vnetCns, ip: opts.nic.ip ? opts.nic.ip.v6address : 'none' }, 'nicBatch: entry'); opts.batch = opts.batch.concat(opts.nic.batch({ log: opts.log, vnetCns: opts.vnetCns })); if (opts.shootdownNIC) { assert.object(opts.existingNic, 'opts.existingNic'); assert.ok(opts.existingNic.isFabric(), 'opts.existingNic.isFabric()'); opts.batch = opts.batch.concat(mod_portolan_moray.vl2CnEventBatch({ log: opts.log, vnetCns: opts.vnetCns, vnet_id: opts.existingNic.network.vnet_id, mac: opts.existingNic.mac.toLong() })); } opts.log.debug({ batch: opts.batch }, 'nicBatch: exit'); callback(); }
}, function (listErr, cns) { if (listErr) { return cb(listErr); } opts.batch.concat(mod_portolan_moray.vl2CnEventBatch({ log: opts.log, vnetCns: cns, vnet_id: opts.existingNic.vnet_id, mac: opts.existingNic.mac })); return cb(); });