a very small start at 'make check' clean

This commit is contained in:
Trent Mick 2015-08-31 16:56:26 -07:00
parent f0f8062f8f
commit 3c90b321fd
2 changed files with 11 additions and 10 deletions

View File

@ -73,11 +73,12 @@ function do_wait_instance(subcmd, opts, args, cb) {
}
uuids.forEach(function (id) {
var opts = {
var waitOpts = {
id: id,
states: states
};
self.triton.cloudapi.waitForMachineStates(opts, function (err, body, res) {
self.triton.cloudapi.waitForMachineStates(waitOpts,
function (err, body, res) {
if (err) {
cb(err);
return;
@ -122,7 +123,7 @@ do_wait_instance.options = [
helpArg: 'STATES',
help: 'Instance states on which to wait. Default is "running,failed".'
+ 'Values can be comma-separated or multiple uses of the option.'
},
}
];
module.exports = do_wait_instance;

View File

@ -166,9 +166,9 @@ Triton.prototype.listImages = function listImages(opts, cb) {
if (!err && self.cacheDir) {
// cache the results
var data = JSON.stringify(imgs);
fs.writeFile(cacheFile, data, {encoding: 'utf8'}, function (err) {
if (err)
self.log.info({err: err}, 'error caching images results');
fs.writeFile(cacheFile, data, {encoding: 'utf8'}, function (err2) {
if (err2)
self.log.info({err: err2}, 'error caching images results');
done();
});
} else {
@ -364,15 +364,15 @@ Triton.prototype.getInstance = function getInstance(name, cb) {
nextOnce(err);
});
s.on('readable', function () {
var inst;
while ((inst = s.read()) !== null) {
if (inst.id.slice(0, shortId.length) === shortId) {
var candidate;
while ((candidate = s.read()) !== null) {
if (candidate.id.slice(0, shortId.length) === shortId) {
if (match) {
return nextOnce(new Error(
'instance short id "%s" is ambiguous',
shortId));
} else {
match = inst;
match = candidate;
}
}
}