From e7109071de8f5460a68af80d9de7a15fe1732c66 Mon Sep 17 00:00:00 2001 From: Dave Eddy Date: Tue, 29 Sep 2015 18:13:34 -0400 Subject: [PATCH] cloudapi and tritonapi exports should match --- lib/cli.js | 4 ++-- lib/cloudapi2.js | 6 ++---- lib/tritonapi.js | 4 +++- 3 files changed, 7 insertions(+), 7 deletions(-) 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); +};