PUBAPI-1268 - remove spinner (-ww) from snapshot create/delete.
This commit is contained in:
		
							parent
							
								
									ba16f0d9ef
								
							
						
					
					
						commit
						7d635fc81c
					
				| @ -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 = [ | ||||||
|  | |||||||
| @ -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 = [ | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user