PUBAPI-1268 - remove spinner (-ww) from snapshot create/delete.

This commit is contained in:
Marsell Kukuljevic 2016-03-08 23:09:29 +11:00
parent ba16f0d9ef
commit 7d635fc81c
2 changed files with 5 additions and 29 deletions

View File

@ -15,7 +15,6 @@ var format = require('util').format;
var vasync = require('vasync'); var vasync = require('vasync');
var common = require('../../common'); var common = require('../../common');
var distractions = require('../../distractions');
var errors = require('../../errors'); var errors = require('../../errors');
@ -72,13 +71,6 @@ function do_create(subcmd, opts, args, cb) {
return next(); return next();
} }
// 1 'wait': no distraction.
// >1 'wait': distraction, pass in the N.
var distraction;
if (process.stderr.isTTY && opts.wait.length > 1) {
distraction = distractions.createDistraction(opts.wait.length);
}
var cloudapi = cli.tritonapi.cloudapi; var cloudapi = cli.tritonapi.cloudapi;
var waiter = cloudapi.waitForSnapshotStates.bind(cloudapi); var waiter = cloudapi.waitForSnapshotStates.bind(cloudapi);
@ -87,10 +79,6 @@ function do_create(subcmd, opts, args, cb) {
name: ctx.name, name: ctx.name,
states: ['created', 'failed'] states: ['created', 'failed']
}, function (err, snap) { }, function (err, snap) {
if (distraction) {
distraction.destroy();
}
if (err) { if (err) {
return next(err); return next(err);
} }
@ -131,9 +119,8 @@ do_create.options = [
}, },
{ {
names: ['wait', 'w'], names: ['wait', 'w'],
type: 'arrayOfBool', type: 'bool',
help: 'Wait for the creation to complete. Use multiple times for a ' + help: 'Wait for the creation to complete.'
'spinner.'
} }
]; ];
do_create.help = [ do_create.help = [

View File

@ -15,7 +15,6 @@ var format = require('util').format;
var vasync = require('vasync'); var vasync = require('vasync');
var common = require('../../common'); var common = require('../../common');
var distractions = require('../../distractions');
var errors = require('../../errors'); var errors = require('../../errors');
@ -37,13 +36,6 @@ function do_delete(subcmd, opts, args, cb) {
var names = args.slice(1, args.length); var names = args.slice(1, args.length);
function wait(instId, name, startTime, next) { function wait(instId, name, startTime, next) {
// 1 'wait': no distraction.
// >1 'wait': distraction, pass in the N.
var distraction;
if (process.stderr.isTTY && opts.wait.length > 1) {
distraction = distractions.createDistraction(opts.wait.length);
}
var cloudapi = cli.tritonapi.cloudapi; var cloudapi = cli.tritonapi.cloudapi;
var waiter = cloudapi.waitForSnapshotStates.bind(cloudapi); var waiter = cloudapi.waitForSnapshotStates.bind(cloudapi);
@ -52,12 +44,10 @@ function do_delete(subcmd, opts, args, cb) {
name: name, name: name,
states: ['deleted'] states: ['deleted']
}, function (err, snap) { }, function (err, snap) {
if (distraction) {
distraction.destroy();
}
if (err) { if (err) {
return next(err); return next(err);
} }
if (snap.state === 'deleted') { if (snap.state === 'deleted') {
var duration = Date.now() - startTime; var duration = Date.now() - startTime;
var durStr = common.humanDurationFromMs(duration); var durStr = common.humanDurationFromMs(duration);
@ -145,9 +135,8 @@ do_delete.options = [
}, },
{ {
names: ['wait', 'w'], names: ['wait', 'w'],
type: 'arrayOfBool', type: 'bool',
help: 'Wait for the deletion to complete. Use multiple times for a ' + help: 'Wait for the deletion to complete.'
'spinner.'
} }
]; ];
do_delete.help = [ do_delete.help = [