commit 886e19ec52e96a52c4a1d34d8126337eea18d66c Author: Arturo Filastò arturo@filasto.net Date: Wed Aug 31 19:42:58 2016 +0200
Don't raise an exception if a deck is already enabled
* Disable debug level logging in web server --- ooni/deck/store.py | 6 +++++- ooni/ui/web/server.py | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ooni/deck/store.py b/ooni/deck/store.py index 295f817..c938d56 100644 --- a/ooni/deck/store.py +++ b/ooni/deck/store.py @@ -162,7 +162,11 @@ class DeckStore(object): if not deck_path.exists(): raise DeckNotFound(deck_id) deck_enabled_path = self.enabled_directory.child(deck_id + '.yaml') - deck_path.linkTo(deck_enabled_path) + try: + deck_path.linkTo(deck_enabled_path) + except OSError as ose: + if ose.errno != errno.EEXIST: + raise
def disable(self, deck_id): deck_enabled_path = self.enabled_directory.child(deck_id + '.yaml') diff --git a/ooni/ui/web/server.py b/ooni/ui/web/server.py index 2e89370..26bfd47 100644 --- a/ooni/ui/web/server.py +++ b/ooni/ui/web/server.py @@ -26,8 +26,6 @@ from ooni.measurements import get_summary, get_measurement, list_measurements from ooni.measurements import MeasurementNotFound, MeasurementInProgress from ooni.geoip import probe_ip
-config.advanced.debug = True - class WebUIError(Exception): def __init__(self, code, message): self.code = code