From 99a083e232e646ebfb94145af0956450acc0e004 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Mon, 15 Feb 2016 10:12:10 -0800 Subject: [PATCH] changelog for #93 #94 fix --- CHANGES.md | 4 +++- lib/tritonapi.js | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c1f61cd..04b4032 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,9 @@ ## 4.5.2 (not yet released) -- #95 Fix breakage of `triton image create` in version 4.5.0. (By Kris Shannon.) +- #95 Fix breakage of `triton image create` in v4.5.0. (By Kris Shannon.) +- #94, #93 `triton inst create ...` is broken if "images.json" cache file + is missing. (By Kris Shannon.) ## 4.5.1 diff --git a/lib/tritonapi.js b/lib/tritonapi.js index bd7cea7..9712caa 100644 --- a/lib/tritonapi.js +++ b/lib/tritonapi.js @@ -205,6 +205,15 @@ TritonApi.prototype._cachePutJson = function _cachePutJson(key, obj, cb) { }); }; +/** + * Lookup the given key in the cache and return a hit or `undefined`. + * + * @param {String} key: The cache key, e.g. 'images.json'. + * @param {Function} cb: `function (err, hit)`. + * `err` is an Error if there was an unexpected error loading from the + * cache. `hit` is undefined if there was no cache hit. On a hit, the + * type of `hit` depends on the key. + */ TritonApi.prototype._cacheGetJson = function _cacheGetJson(key, cb) { var self = this; assert.string(this.cacheDir, 'this.cacheDir');