diff --git a/lib/cli.js b/lib/cli.js index ca20661..b169def 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -27,7 +27,7 @@ var vasync = require('vasync'); var common = require('./common'); var mod_config = require('./config'); var errors = require('./errors'); -var TritonApi = require('./tritonapi'); +var tritonapi = require('./tritonapi'); @@ -223,7 +223,7 @@ CLI.prototype.init = function (opts, args, callback) { self._applyProfileOverrides(profile); self.log.trace({profile: profile}, 'loaded profile'); - self._tritonapi = new TritonApi({ + self._tritonapi = tritonapi.createClient({ log: self.log, profile: profile, config: config diff --git a/lib/cloudapi2.js b/lib/cloudapi2.js index 1638cc0..40e6b30 100644 --- a/lib/cloudapi2.js +++ b/lib/cloudapi2.js @@ -651,8 +651,6 @@ CloudApi.prototype.machineAudit = function machineAudit(id, cb) { // --- Exports -module.exports = { - createClient: function (options) { - return new CloudApi(options); - } +module.exports.createClient = function (options) { + return new CloudApi(options); }; diff --git a/lib/tritonapi.js b/lib/tritonapi.js index fe02a6c..7747077 100644 --- a/lib/tritonapi.js +++ b/lib/tritonapi.js @@ -527,4 +527,6 @@ TritonApi.prototype.getInstance = function getInstance(name, cb) { //---- exports -module.exports = TritonApi; +module.exports.createClient = function (options) { + return new TritonApi(options); +};