Skip to content

Commit

Permalink
Fix inconsistent behaviour
Browse files Browse the repository at this point in the history
The modified methods are supposed to return a Promise if callback is
undefined
  • Loading branch information
knight42 committed Mar 13, 2017
1 parent 1c65e2d commit 4c27023
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 56 deletions.
6 changes: 0 additions & 6 deletions lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ Container.prototype.inspect = function(opts, callback) {
var self = this;
var args = util.processArgs(opts, callback);

if (typeof args.callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/containers/' + this.id + '/json?',
method: 'GET',
Expand Down
5 changes: 0 additions & 5 deletions lib/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ Exec.prototype.resize = function(opts, callback) {
*/
Exec.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/exec/' + this.id + '/json',
Expand Down
5 changes: 0 additions & 5 deletions lib/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ var Image = function(modem, name) {
*/
Image.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
name: this.name
});
}

var opts = {
path: '/images/' + this.name + '/json',
Expand Down
5 changes: 0 additions & 5 deletions lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ var Network = function(modem, id) {
*/
Network.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
Id: this.id
});
}

var opts = {
path: '/networks/' + this.id,
Expand Down
10 changes: 0 additions & 10 deletions lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ var Node = function(modem, id) {
*/
Node.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/nodes/' + this.id,
Expand Down Expand Up @@ -102,11 +97,6 @@ Node.prototype.update = function(opts, callback) {
*/
Node.prototype.remove = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/nodes/' + this.id,
Expand Down
5 changes: 0 additions & 5 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ var Plugin = function(modem, name, remote) {
*/
Plugin.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
name: this.name
});
}

var optsf = {
path: '/plugins/' + this.name,
Expand Down
5 changes: 0 additions & 5 deletions lib/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ var Secret = function(modem, id) {
*/
Secret.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/secrets/' + this.id,
Expand Down
5 changes: 0 additions & 5 deletions lib/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ var Service = function(modem, id) {
*/
Service.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/services/' + this.id,
Expand Down
5 changes: 0 additions & 5 deletions lib/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ var Task = function(modem, id) {
*/
Task.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
id: this.id
});
}

var optsf = {
path: '/tasks/' + this.id,
Expand Down
5 changes: 0 additions & 5 deletions lib/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ var Volume = function(modem, name) {
*/
Volume.prototype.inspect = function(callback) {
var self = this;
if (typeof callback !== 'function') {
return JSON.stringify({
name: this.name
});
}

var optsf = {
path: '/volumes/' + this.name,
Expand Down

0 comments on commit 4c27023

Please sign in to comment.