
This patch adds 'configure-devstack' task to enable CORS headers in keystone before functional-test are run. No 'ini' library was used as I didn't find any supporting section syntax "[[post-config|$KEYSTONE_CONF]]" Change-Id: I7f335bbba3a768387a7d77916df019ba46e5519f
18 lines
485 B
JavaScript
18 lines
485 B
JavaScript
/*eslint no-process-env: "off" */
|
|
import fs from 'fs';
|
|
import karma from 'karma/lib/config';
|
|
import path from 'path';
|
|
|
|
function getDevstackConfig() {
|
|
const karmaConfig = karma.parseConfig(path.resolve('./karma.conf.js'));
|
|
return "[[post-config|$KEYSTONE_CONF]]\n" +
|
|
"[cors]\n" +
|
|
"allowed_origin=http://localhost:" + karmaConfig.port + "\n";
|
|
}
|
|
|
|
fs.appendFile(process.env.BASE + '/new/devstack/local.conf', getDevstackConfig(), (err) => {
|
|
if (err) {
|
|
throw err;
|
|
}
|
|
});
|