Permalink
Browse files

smartos-live#87 fixed a problem with DSadm and multople sources.

  • Loading branch information...
1 parent e145374 commit aa774465f98a8ade515c1cc286d957130a403a79 @wesolows wesolows committed Jun 28, 2012
Showing with 4 additions and 9 deletions.
  1. +4 −9 src/img/node_modules/imgadm.js
View
13 src/img/node_modules/imgadm.js
@@ -280,14 +280,10 @@ var cacheList = function (callback) {
};
var cacheUpdate = function (callback) {
- var body;
var cache = [];
var complete;
var counter;
- var i;
var next;
- var options;
- var source;
var sources = loadSources(DB_SOURCES);
counter = sources.length;
@@ -313,14 +309,13 @@ var cacheUpdate = function (callback) {
};
log.info('updating local images database...');
- for (i = 0; i < sources.length; i++) {
- body = '';
- source = sources[i];
- options = url.parse(sources[i]);
+ sources.forEach(function (source) {
+ var options = url.parse(source);
// SmartOS DNS is disabled by default
dns.resolve4(options.hostname, function (err, addresses) {
var client;
+ var body = '';
if (err) {
callback('could not resolve host: ' + options.hostname);
@@ -352,7 +347,7 @@ var cacheUpdate = function (callback) {
});
});
});
- }
+ });
};
// returns manifest specified by uuid

0 comments on commit aa77446

Please sign in to comment.