info cleanup

This commit is contained in:
Dave Eddy 2015-09-04 13:44:40 -04:00
parent 7a7c204140
commit 11543f23b8

View File

@ -65,12 +65,12 @@ function do_info(subcmd, opts, args, callback) {
data.name = name; data.name = name;
data.email = out.account.email; data.email = out.account.email;
data.url = self.triton.cloudapi.url; data.url = self.triton.cloudapi.url;
data.totalInstances = out.machines.length;
data.totalDisk = disk; data.totalDisk = disk;
data.totalMemory = memory; data.totalMemory = memory;
if (opts.json) { if (opts.json) {
data.machines = states; data.totalInstances = out.machines.length;
data.instances = states;
console.log(JSON.stringify(data)); console.log(JSON.stringify(data));
} else { } else {
data.totalDisk = common.humanSizeFromBytes(disk); data.totalDisk = common.humanSizeFromBytes(disk);
@ -78,8 +78,9 @@ function do_info(subcmd, opts, args, callback) {
Object.keys(data).forEach(function (key) { Object.keys(data).forEach(function (key) {
console.log('%s: %s', key, data[key]); console.log('%s: %s', key, data[key]);
}); });
console.log('instances: %d', out.machines.length);
Object.keys(states).forEach(function (key) { Object.keys(states).forEach(function (key) {
console.log('machines.%s: %s', key, states[key]); console.log(' %s: %d', key, states[key]);
}); });
} }
callback(); callback();