Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/222766

Change subject: Make loading config.yaml optional
......................................................................

Make loading config.yaml optional

Change-Id: I3b7b6b0c94e9ecabc7b130b95b3353263772ebf8
---
M quarry/web/app.py
M quarry/web/killer.py
M quarry/web/worker.py
3 files changed, 15 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/quarry/web 
refs/changes/66/222766/1

diff --git a/quarry/web/app.py b/quarry/web/app.py
index 28f82c5..5328bd5 100644
--- a/quarry/web/app.py
+++ b/quarry/web/app.py
@@ -26,7 +26,11 @@
 
 app = Flask(__name__)
 app.config.update(yaml.load(open(os.path.join(__dir__, 
"../default_config.yaml"))))
-app.config.update(yaml.load(open(os.path.join(__dir__, "../config.yaml"))))
+try:
+    app.config.update(yaml.load(open(os.path.join(__dir__, "../config.yaml"))))
+except IOError:
+    # Is ok if we can't load config.yaml
+    pass
 app.config['DEBUG'] = True
 app.session_interface = RedisSessionInterface()
 
diff --git a/quarry/web/killer.py b/quarry/web/killer.py
index c0de439..fb4d253 100755
--- a/quarry/web/killer.py
+++ b/quarry/web/killer.py
@@ -7,7 +7,11 @@
 
 __dir__ = os.path.dirname(__file__)
 config = yaml.load(open(os.path.join(__dir__, "../default_config.yaml")))
-config.update(yaml.load(open(os.path.join(__dir__, "../config.yaml"))))
+try:
+    config.update(yaml.load(open(os.path.join(__dir__, "../config.yaml"))))
+except IOError:
+    # is ok if we do not have config.yaml
+    pass
 
 logging.basicConfig(
     filename=config['KILLER_LOG_PATH'],
diff --git a/quarry/web/worker.py b/quarry/web/worker.py
index ff11395..6c90863 100644
--- a/quarry/web/worker.py
+++ b/quarry/web/worker.py
@@ -16,7 +16,11 @@
 
 celery = Celery('quarry.web.worker')
 celery.conf.update(yaml.load(open(os.path.join(__dir__, 
"../default_config.yaml"))))
-celery.conf.update(yaml.load(open(os.path.join(__dir__, "../config.yaml"))))
+try:
+    celery.conf.update(yaml.load(open(os.path.join(__dir__, 
"../config.yaml"))))
+except IOError:
+    # Is ok if we can not load config.yaml
+    pass
 
 conn = None
 

-- 
To view, visit https://gerrit.wikimedia.org/r/222766
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b7b6b0c94e9ecabc7b130b95b3353263772ebf8
Gerrit-PatchSet: 1
Gerrit-Project: analytics/quarry/web
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to