Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/284872

Change subject: Fix the registry file reading
......................................................................

Fix the registry file reading

If registry is not provided in the service configuraiton, __dirname was
getting appended twice.

Regression from I5a3b87141da586955b5749e96f683262561c1bbd

Change-Id: Ic4a489244a4524d2a904fca4081cbd5edc65fdfb
---
M app.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/cxserver 
refs/changes/72/284872/1

diff --git a/app.js b/app.js
index 9d01ce4..7133b50 100644
--- a/app.js
+++ b/app.js
@@ -73,11 +73,13 @@
        // set up the registry
        if ( !app.conf.registry ) {
                app.conf.registry = __dirname + '/registry.yaml';
+       } else if ( typeof app.conf.registry === 'string' ) {
+               app.conf.registry = __dirname + '/' + app.conf.registry;
        }
 
        if ( app.conf.registry.constructor !== Object ) {
                try {
-                       app.conf.registry = yaml.safeLoad( fs.readFileSync( 
__dirname + '/' + app.conf.registry ) );
+                       app.conf.registry = yaml.safeLoad( fs.readFileSync( 
app.conf.registry ) );
                } catch ( e ) {
                        app.logger.log( 'warn/registry', 'Could not load the 
registry: ' + e );
                        app.conf.registry = {};

-- 
To view, visit https://gerrit.wikimedia.org/r/284872
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4a489244a4524d2a904fca4081cbd5edc65fdfb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/cxserver
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to