Files
js-openstack-lib/configure-devstack.js
Corentin Ardeois b033ad652e Added Neutron Service
This neutron service follows the same pattern as the glance service,
and provides both version negotiation and endpoint discovery.

Change-Id: Ia2f59213eedf6d7acbb02789ee921c13ff391d09
2016-09-26 14:05:34 -04:00

27 lines
665 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 getCorsConfig('$KEYSTONE_CONF', karmaConfig) +
getCorsConfig('$GLANCE_API_CONF', karmaConfig) +
getCorsConfig('$NEUTRON_CONF', karmaConfig);
}
function getCorsConfig(service, karmaConfig) {
return `[[post-config|${service}]]
[cors]
allowed_origin=http://localhost:${karmaConfig.port}
`;
}
fs.appendFile(process.env.BASE + '/new/devstack/local.conf', getDevstackConfig(), (err) => {
if (err) {
throw err;
}
});