joyent/node-triton#154 #108 changes broke triton cloudapi ...
This commit is contained in:
parent
ad7d608011
commit
f7bbe5fcff
@ -7,6 +7,8 @@ Known issues:
|
|||||||
|
|
||||||
## not yet released
|
## not yet released
|
||||||
|
|
||||||
|
- [joyent/node-triton#154] Fix `triton cloudapi ...` after #108 changes.
|
||||||
|
|
||||||
- **BREAKING CHANGE for module usage of node-triton.**
|
- **BREAKING CHANGE for module usage of node-triton.**
|
||||||
To implement joyent/node-triton#108, the way a TritonApi client is
|
To implement joyent/node-triton#108, the way a TritonApi client is
|
||||||
setup for use has changed from being (unrealistically) sync to async.
|
setup for use has changed from being (unrealistically) sync to async.
|
||||||
|
@ -11,7 +11,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
var http = require('http');
|
var http = require('http');
|
||||||
|
var vasync = require('vasync');
|
||||||
|
|
||||||
|
var common = require('./common');
|
||||||
var errors = require('./errors');
|
var errors = require('./errors');
|
||||||
|
|
||||||
|
|
||||||
@ -62,9 +64,14 @@ function do_cloudapi(subcmd, opts, args, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tritonapi.cloudapi._request(reqOpts, function (err, req, res, body) {
|
vasync.pipeline({arg: {cli: this}, funcs: [
|
||||||
|
common.cliSetupTritonApi,
|
||||||
|
|
||||||
|
function callCloudapi(ctx, next) {
|
||||||
|
var cloudapi = ctx.cli.tritonapi.cloudapi;
|
||||||
|
cloudapi._request(reqOpts, function (err, req, res, body) {
|
||||||
if (err) {
|
if (err) {
|
||||||
callback(err);
|
next(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (opts.headers || reqOpts.method === 'head') {
|
if (opts.headers || reqOpts.method === 'head') {
|
||||||
@ -81,8 +88,10 @@ function do_cloudapi(subcmd, opts, args, callback) {
|
|||||||
|
|
||||||
if (reqOpts.method !== 'head')
|
if (reqOpts.method !== 'head')
|
||||||
console.log(JSON.stringify(body, null, 4));
|
console.log(JSON.stringify(body, null, 4));
|
||||||
callback();
|
next();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
]}, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
do_cloudapi.options = [
|
do_cloudapi.options = [
|
||||||
|
Reference in New Issue
Block a user