From 4b8217d4ad3688eb1ebb8b36900f9ae6557467cb Mon Sep 17 00:00:00 2001 From: jakedt Date: Fri, 11 Apr 2014 19:23:57 -0400 Subject: [PATCH] Add config to allow for setting the queue names at runtime. Fix a bug in the data model. --- Dockerfile | 2 +- config.py | 3 +++ data/model/legacy.py | 2 +- data/queue.py | 6 +++--- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a036bdad..daaf413b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND noninteractive ENV HOME /root RUN apt-get update -RUN apt-get install -y git python-virtualenv python-dev phantomjs libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev libevent-dev gdebi-core g++ +RUN apt-get install -y git python-virtualenv python-dev phantomjs libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev libevent-dev gdebi-core g++ libmagic1 ADD binary_dependencies binary_dependencies RUN gdebi --n binary_dependencies/*.deb diff --git a/config.py b/config.py index 45e6ae0bb..8e454040d 100644 --- a/config.py +++ b/config.py @@ -123,6 +123,9 @@ class DefaultConfig(object): with open(tag_path) as tag_svg: STATUS_TAGS[tag_name] = tag_svg.read() + WEBHOOK_QUEUE_NAME = 'webhook' + DIFFS_QUEUE_NAME = 'imagediff' + DOCKERFILE_BUILD_QUEUE_NAME = 'dockerfilebuild' # Super user config. Note: This MUST BE an empty list for the default config. SUPER_USERS = [] diff --git a/data/model/legacy.py b/data/model/legacy.py index aebd2a207..98583907d 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1527,7 +1527,7 @@ def list_logs(start_time, end_time, performer=None, repository=None, namespace=N joined = joined.where(LogEntry.performer == performer) if namespace: - joined = joined.where(User.username == namespace_name) + joined = joined.where(User.username == namespace) return joined.where( LogEntry.datetime >= start_time, diff --git a/data/queue.py b/data/queue.py index b4b53faa5..af1df3045 100644 --- a/data/queue.py +++ b/data/queue.py @@ -93,6 +93,6 @@ class WorkQueue(object): queue_item.save() -image_diff_queue = WorkQueue('imagediff') -dockerfile_build_queue = WorkQueue('dockerfilebuild') -webhook_queue = WorkQueue('webhook') +image_diff_queue = WorkQueue(app.config['DIFFS_QUEUE_NAME']) +dockerfile_build_queue = WorkQueue(app.config['DOCKERFILE_BUILD_QUEUE_NAME']) +webhook_queue = WorkQueue(app.config['WEBHOOK_QUEUE_NAME'])