Skip to content
This repository
Browse code

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

  • Loading branch information...
commit aa774465f98a8ade515c1cc286d957130a403a79 1 parent e145374
Keith M Wesolowski authored June 28, 2012

Showing 1 changed file with 4 additions and 9 deletions. Show diff stats Hide diff stats

  1. 13  src/img/node_modules/imgadm.js
13  src/img/node_modules/imgadm.js
@@ -280,14 +280,10 @@ var cacheList = function (callback) {
280 280
 };
281 281
 
282 282
 var cacheUpdate = function (callback) {
283  
-    var body;
284 283
     var cache = [];
285 284
     var complete;
286 285
     var counter;
287  
-    var i;
288 286
     var next;
289  
-    var options;
290  
-    var source;
291 287
     var sources = loadSources(DB_SOURCES);
292 288
 
293 289
     counter = sources.length;
@@ -313,14 +309,13 @@ var cacheUpdate = function (callback) {
313 309
     };
314 310
 
315 311
     log.info('updating local images database...');
316  
-    for (i = 0; i < sources.length; i++) {
317  
-        body = '';
318  
-        source = sources[i];
319  
-        options = url.parse(sources[i]);
  312
+    sources.forEach(function (source) {
  313
+        var options = url.parse(source);
320 314
 
321 315
         // SmartOS DNS is disabled by default
322 316
         dns.resolve4(options.hostname, function (err, addresses) {
323 317
             var client;
  318
+            var body = '';
324 319
 
325 320
             if (err) {
326 321
                 callback('could not resolve host: ' + options.hostname);
@@ -352,7 +347,7 @@ var cacheUpdate = function (callback) {
352 347
                 });
353 348
             });
354 349
         });
355  
-    }
  350
+    });
356 351
 };
357 352
 
358 353
 // returns manifest specified by uuid

0 notes on commit aa77446

Please sign in to comment.
Something went wrong with that request. Please try again.