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 common = require('../../common');
var distractions = require('../../distractions');
var errors = require('../../errors');
@ -72,13 +71,6 @@ function do_create(subcmd, opts, args, cb) {
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 waiter = cloudapi.waitForSnapshotStates.bind(cloudapi);
@ -87,10 +79,6 @@ function do_create(subcmd, opts, args, cb) {
name: ctx.name,
states: ['created', 'failed']
}, function (err, snap) {
if (distraction) {
distraction.destroy();
}
if (err) {
return next(err);
}
@ -131,9 +119,8 @@ do_create.options = [
},
{
names: ['wait', 'w'],
type: 'arrayOfBool',
help: 'Wait for the creation to complete. Use multiple times for a ' +
'spinner.'
type: 'bool',
help: 'Wait for the creation to complete.'
}
];
do_create.help = [

View File

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