Rewrite config from /etc/airtime-saas to plain /etc/airtime

This is the results of sed -i -e 's|/etc/airtime-saas/|/etc/airtime/|' `grep -irl 'airtime-saas' airtime_mvc/ python_apps/` :P

It might need more testing, the airtime-saas part never really made sense, zf1 has environments for that, ie you would create a saas env based on production for instance.

I beleive legacy upstream was using this to share configuration between customers (ie. analyser runs only once and writes to a shared S3 bucket). I assume they mount the airtime-saas folder onto individual customers instances with a global config. Like I said, I don't feel that this makes sense since all it does is make hacking at the configs in airtime-saas a bit easier. A serious SaaS operation should be using something like puppet or ansible to achieve this.
This commit is contained in:
Lucas Bickel 2017-02-20 21:36:13 +01:00
parent 4557395a86
commit e28ad471f9
8 changed files with 23 additions and 18 deletions

View file

@ -81,16 +81,18 @@ class Application_Model_RabbitMq
public static function getRmqConfigPath() {
//Hack for Airtime Pro. The RabbitMQ settings for communicating with airtime_analyzer are global
//and shared between all instances on Airtime Pro.
//
// todo: rewrite me to only use the config class and not access /etc/airtime directly
$CC_CONFIG = Config::getConfig();
$devEnv = "production"; //Default
if (array_key_exists("dev_env", $CC_CONFIG)) {
$devEnv = $CC_CONFIG["dev_env"];
}
$rmq_config_path = "/etc/airtime-saas/".$devEnv."/rabbitmq-analyzer.ini";
$rmq_config_path = LIBRETIME_CONF_DIR . '/' . $devEnv."/rabbitmq-analyzer.ini";
if (!file_exists($rmq_config_path)) {
// If the dev env specific rabbitmq-analyzer.ini doesn't exist default
// to the production rabbitmq-analyzer.ini
$rmq_config_path = "/etc/airtime-saas/production/rabbitmq-analyzer.ini";
$rmq_config_path = LIBRETIME_CONF_PATH . "/production/rabbitmq-analyzer.ini";
}
return $rmq_config_path;
}