diff --git a/pandora/settings.py b/pandora/settings.py index 0ad4af0f8..f232f2f3f 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -170,11 +170,8 @@ DATABASES = { #rabbitmq connection settings CELERY_RESULT_BACKEND = "database" -BROKER_HOST = "127.0.0.1" -BROKER_PORT = 5672 -BROKER_USER = "pandora" -BROKER_PASSWORD = "box" -BROKER_VHOST = "/pandora" +BROKER_URL = 'amqp://pandora:box@localhost:5672//pandora' + SEND_CELERY_ERROR_EMAILS = False #with apache x-sendfile or lighttpd set this to True diff --git a/update.py b/update.py index d9da9da92..ade417829 100755 --- a/update.py +++ b/update.py @@ -102,6 +102,25 @@ if __name__ == "__main__": run('./bin/pip', 'install', '-r', 'requirements.txt') if old < 4379: run('./bin/pip', 'install', '-r', 'requirements.txt') + if old < 4549: + import pandora.settings + with open('pandora/local_settings.py', 'r') as f: + local_settings = f.read() + if not 'BROKER_URL' in local_settings: + broker_url = 'amqp://%s:%s@%s:%s/%s' % ( + getattr(pandora.settings, 'BROKER_USER', 'pandora'), + getattr(pandora.settings, 'BROKER_PASSWORD', 'box'), + getattr(pandora.settings, 'BROKER_HOST', '127.0.0.1'), + getattr(pandora.settings, 'BROKER_PORT', 5672), + getattr(pandora.settings, 'BROKER_VHOST', '/pandora'), + ) + local_settings = [ + l for l in local_settings.split('\n') if not l.startswith('BROKER_') + ] + [ + 'BROKER_URL = "%s"' % broker_url, '' + ] + with open('pandora/local_settings.py', 'w') as f: + f.write('\n'.join(local_settings)) else: if len(sys.argv) == 1: diff --git a/vm/firstboot.sh b/vm/firstboot.sh index bfeaee33c..01c90a70a 100755 --- a/vm/firstboot.sh +++ b/vm/firstboot.sh @@ -128,7 +128,7 @@ DATABASES = { 'PASSWORD': '', } } -BROKER_PASSWORD = "$RABBITPWD" +BROKER_URL = 'amqp://pandora:$RABBITPWD@localhost:5672//pandora' XACCELREDIRECT = True DEBUG = False