From: Nizamudeen A Date: Wed, 9 Feb 2022 15:36:16 +0000 (+0530) Subject: mgr/dashboard: change the readFile to readFileSync X-Git-Tag: v18.0.0~1410^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F44956%2Fhead;p=ceph.git mgr/dashboard: change the readFile to readFileSync Apparently the readFile i added in #44934 is async and that's not what we want. so changing it to the synchronous call that is readFileSync Fixes: https://tracker.ceph.com/issues/54190 Signed-off-by: Nizamudeen A --- diff --git a/src/pybind/mgr/dashboard/frontend/applitools.config.js b/src/pybind/mgr/dashboard/frontend/applitools.config.js index be93a0050c9f..4aaedf23e5ae 100644 --- a/src/pybind/mgr/dashboard/frontend/applitools.config.js +++ b/src/pybind/mgr/dashboard/frontend/applitools.config.js @@ -1,12 +1,9 @@ -const fs = require('fs') -var branch = new String(); +const fs = require('fs'); // Read the contents of the ceph_release file to retrieve // the branch -fs.readFile('../../../../ceph_release', (_, data) => { - branch = data.toString().split('\n')[1]; -}); - +const cephRelease = fs.readFileSync('../../../../ceph_release', 'utf8').split('\n'); +const branch = cephRelease[2] === 'dev' ? 'master' : cephRelease[1]; module.exports = { appName: 'Ceph Dashboard', batchId: process.env.APPLITOOLS_BATCH_ID,