Skip to content
This repository
Browse code

OS-1941: 'imgadm import UUID' broken, and make check

  • Loading branch information...
commit 6270cb393761ff4940ae3e2365eb0b6dd2898123 1 parent e76e4a5
Trent Mick trentm authored

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

  1. +9 21 src/img/lib/imgadm.js
30 src/img/lib/imgadm.js
@@ -309,20 +309,6 @@ Source.prototype.getNormUrl = function getNormUrl(callback) {
309 309 };
310 310
311 311
312   -/**
313   - * Ping check against the source server.
314   - *
315   - * @param callback {Function} `function (pingErr)`
316   - */
317   -Source.prototype.pingCheck = function pingCheck(callback) {
318   - assert.func(callback, 'callback');
319   -
320   - var self = this;
321   - sourcePingCheck
322   -};
323   -
324   -
325   -
326 312
327 313 // ---- IMGADM tool
328 314
@@ -416,14 +402,14 @@ IMGADM.prototype._addSource = function _addSource(
416 402 var self = this;
417 403
418 404 // Ping-test against the new URL
419   - function sourcePingCheck(s, next) {
  405 + function sourcePingCheck(sourceToPing, next) {
420 406 if (skipPingCheck) {
421 407 next();
422 408 return;
423 409 }
424 410
425   - self.log.trace({source: s.url}, 'sourcePingCheck');
426   - self.clientFromSource(s, function (cErr, client) {
  411 + self.log.trace({source: sourceToPing.url}, 'sourcePingCheck');
  412 + self.clientFromSource(sourceToPing, function (cErr, client) {
427 413 if (cErr) {
428 414 next(cErr);
429 415 return;
@@ -431,9 +417,9 @@ IMGADM.prototype._addSource = function _addSource(
431 417 client.ping(function (err, pong, res) {
432 418 if (err
433 419 || res.statusCode !== 200
434   - || (s.type === 'imgapi' && !pong.imgapi))
  420 + || (sourceToPing.type === 'imgapi' && !pong.imgapi))
435 421 {
436   - next(new errors.SourcePingError(err, s));
  422 + next(new errors.SourcePingError(err, sourceToPing));
437 423 return;
438 424 }
439 425 next();
@@ -617,7 +603,7 @@ IMGADM.prototype.updateSourceUrls = function updateSourceUrls(
617 603 async.forEachSeries(
618 604 newSources,
619 605 function oneSource(s, next) {
620   - self._addSource(s, skipPingCheck, next)
  606 + self._addSource(s, skipPingCheck, next);
621 607 },
622 608 function doneSources(err) {
623 609 if (err) {
@@ -673,7 +659,8 @@ IMGADM.prototype.sourceFromUrl = function sourceFromUrl(sourceUrl) {
673 659 * @param source {Source}
674 660 * @param callback {Function} `function (err, client)`
675 661 */
676   -IMGADM.prototype.clientFromSource = function clientFromSource(source, callback) {
  662 +IMGADM.prototype.clientFromSource = function clientFromSource(
  663 + source, callback) {
677 664 var self = this;
678 665 assert.object(source, 'source');
679 666 assert.func(callback, 'callback');
@@ -1133,6 +1120,7 @@ IMGADM.prototype.sourcesGet = function sourcesGet(uuid, callback) {
1133 1120 */
1134 1121 IMGADM.prototype.sourceGetFileStream = function sourceGetFileStream(
1135 1122 imageInfo, callback) {
  1123 + var self = this;
1136 1124 assert.object(imageInfo, 'imageInfo');
1137 1125 assert.object(imageInfo.manifest, 'imageInfo.manifest');
1138 1126 assert.object(imageInfo.source, 'imageInfo.source');

0 comments on commit 6270cb3

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