a very small start at 'make check' clean
This commit is contained in:
parent
f0f8062f8f
commit
3c90b321fd
@ -73,11 +73,12 @@ function do_wait_instance(subcmd, opts, args, cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uuids.forEach(function (id) {
|
uuids.forEach(function (id) {
|
||||||
var opts = {
|
var waitOpts = {
|
||||||
id: id,
|
id: id,
|
||||||
states: states
|
states: states
|
||||||
};
|
};
|
||||||
self.triton.cloudapi.waitForMachineStates(opts, function (err, body, res) {
|
self.triton.cloudapi.waitForMachineStates(waitOpts,
|
||||||
|
function (err, body, res) {
|
||||||
if (err) {
|
if (err) {
|
||||||
cb(err);
|
cb(err);
|
||||||
return;
|
return;
|
||||||
@ -122,7 +123,7 @@ do_wait_instance.options = [
|
|||||||
helpArg: 'STATES',
|
helpArg: 'STATES',
|
||||||
help: 'Instance states on which to wait. Default is "running,failed".'
|
help: 'Instance states on which to wait. Default is "running,failed".'
|
||||||
+ 'Values can be comma-separated or multiple uses of the option.'
|
+ 'Values can be comma-separated or multiple uses of the option.'
|
||||||
},
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = do_wait_instance;
|
module.exports = do_wait_instance;
|
||||||
|
@ -166,9 +166,9 @@ Triton.prototype.listImages = function listImages(opts, cb) {
|
|||||||
if (!err && self.cacheDir) {
|
if (!err && self.cacheDir) {
|
||||||
// cache the results
|
// cache the results
|
||||||
var data = JSON.stringify(imgs);
|
var data = JSON.stringify(imgs);
|
||||||
fs.writeFile(cacheFile, data, {encoding: 'utf8'}, function (err) {
|
fs.writeFile(cacheFile, data, {encoding: 'utf8'}, function (err2) {
|
||||||
if (err)
|
if (err2)
|
||||||
self.log.info({err: err}, 'error caching images results');
|
self.log.info({err: err2}, 'error caching images results');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -364,15 +364,15 @@ Triton.prototype.getInstance = function getInstance(name, cb) {
|
|||||||
nextOnce(err);
|
nextOnce(err);
|
||||||
});
|
});
|
||||||
s.on('readable', function () {
|
s.on('readable', function () {
|
||||||
var inst;
|
var candidate;
|
||||||
while ((inst = s.read()) !== null) {
|
while ((candidate = s.read()) !== null) {
|
||||||
if (inst.id.slice(0, shortId.length) === shortId) {
|
if (candidate.id.slice(0, shortId.length) === shortId) {
|
||||||
if (match) {
|
if (match) {
|
||||||
return nextOnce(new Error(
|
return nextOnce(new Error(
|
||||||
'instance short id "%s" is ambiguous',
|
'instance short id "%s" is ambiguous',
|
||||||
shortId));
|
shortId));
|
||||||
} else {
|
} else {
|
||||||
match = inst;
|
match = candidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user