From 51a8b2e77932a0500b2ec5e9c97d71fb70628e9b Mon Sep 17 00:00:00 2001 From: David Cramer Date: Sat, 8 Oct 2011 07:48:26 -0400 Subject: [PATCH] Rename SENTRY_REMOTE_URL to SENTRY_SERVERS --- docs/config/django.rst | 2 +- docs/config/flask.rst | 2 +- docs/config/index.rst | 2 +- docs/config/logging.rst | 2 +- docs/usage.rst | 2 +- raven/base.py | 6 +++--- raven/conf/defaults.py | 2 +- raven/contrib/django/models.py | 2 +- raven/contrib/flask/__init__.py | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/config/django.rst b/docs/config/django.rst index 9a605ba49..5981422c6 100644 --- a/docs/config/django.rst +++ b/docs/config/django.rst @@ -13,7 +13,7 @@ Using the Django integration is as simple as adding Raven to your installed apps Additional settings for the client are configured using ``SENTRY_``:: SENTRY_KEY = 'my secret key' - SENTRY_REMOTE_URLS = ['http://sentry.local/store/'] + SENTRY_SERVERS = ['http://sentry.local/store/'] Integration with ``logging`` ---------------------------- diff --git a/docs/config/flask.rst b/docs/config/flask.rst index 90fc3130f..0a2c02184 100644 --- a/docs/config/flask.rst +++ b/docs/config/flask.rst @@ -14,4 +14,4 @@ The first thing you'll need to do is to initialize Raven under your application: Additional settings for the client are configured using ``SENTRY_`` in your application's configuration:: SENTRY_KEY = 'my secret key' - SENTRY_REMOTE_URLS = ['http://sentry.local/store/'] \ No newline at end of file + SENTRY_SERVERS = ['http://sentry.local/store/'] \ No newline at end of file diff --git a/docs/config/index.rst b/docs/config/index.rst index c6a4353f0..d7efd13bb 100644 --- a/docs/config/index.rst +++ b/docs/config/index.rst @@ -23,7 +23,7 @@ Settings are specified as part of the intialization of the client. For example:: from raven import Client - client = Client(remote_urls=['http://sentry.local/store/']) + client = Client(servers=['http://sentry.local/store/']) name ~~~~ diff --git a/docs/config/logging.rst b/docs/config/logging.rst index 6f6921489..9a0edf758 100644 --- a/docs/config/logging.rst +++ b/docs/config/logging.rst @@ -9,7 +9,7 @@ Sentry supports the ability to directly tie into the ``logging`` module. To use from raven import Client from raven.handlers.logging import SentryHandler - client = Client(remote_urls=['http://sentry.local/store/'], key='MY SECRET KEY') + client = Client(servers=['http://sentry.local/store/'], key='MY SECRET KEY') logger = logging.getLogger() # ensure we havent already registered the handler diff --git a/docs/usage.rst b/docs/usage.rst index 92c9acb6f..b39f5d940 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -7,7 +7,7 @@ TODO :) from raven import Client - client = Client(remote_urls=['http://sentry.local/store/']) + client = Client(servers=['http://sentry.local/store/']) try: ... diff --git a/raven/base.py b/raven/base.py index 5cc56dbf9..a0150827d 100644 --- a/raven/base.py +++ b/raven/base.py @@ -32,7 +32,7 @@ def __init__(self, *args, **kwargs): self.include_paths = kwargs.get('include_paths') or settings.INCLUDE_PATHS self.exclude_paths = kwargs.get('exclude_paths') or settings.EXCLUDE_PATHS self.remote_timeout = kwargs.get('remote_timeout') or settings.REMOTE_TIMEOUT - self.remote_urls = kwargs.get('remote_urls') or settings.REMOTE_URL + self.servers = kwargs.get('servers') or settings.SERVERS self.name = kwargs.get('name') or settings.NAME self.auto_log_stacks = kwargs.get('auto_log_stacks') or settings.AUTO_LOG_STACKS self.key = kwargs.get('key') or settings.KEY @@ -122,9 +122,9 @@ def send_remote(self, url, data, headers={}): def send(self, **kwargs): "Sends the message to the server." - if self.remote_urls: + if self.servers: message = base64.b64encode(json.dumps(kwargs).encode('zlib')) - for url in self.remote_urls: + for url in self.servers: timestamp = time.time() signature = get_signature(self.key, message, timestamp) headers = { diff --git a/raven/conf/defaults.py b/raven/conf/defaults.py index 7c7b9212c..fb6e5dd95 100644 --- a/raven/conf/defaults.py +++ b/raven/conf/defaults.py @@ -21,7 +21,7 @@ KEY = socket.gethostname() + '1304u13oafjadf0913j4' # This should be the full URL to sentries store view -REMOTE_URL = None +SERVERS = None REMOTE_TIMEOUT = 5 diff --git a/raven/contrib/django/models.py b/raven/contrib/django/models.py index 2e6004f09..c6f25514c 100644 --- a/raven/contrib/django/models.py +++ b/raven/contrib/django/models.py @@ -55,7 +55,7 @@ def configure_settings(): if 'REMOTE_URL' in values: v = values['REMOTE_URL'] if isinstance(v, basestring): - values['REMOTE_URL'] = [v] + values['REMOTES'] = [v] elif not isinstance(v, (list, tuple)): raise ValueError("Sentry setting 'REMOTE_URL' must be of type list.") diff --git a/raven/contrib/flask/__init__.py b/raven/contrib/flask/__init__.py index 2880396e0..b078438e8 100644 --- a/raven/contrib/flask/__init__.py +++ b/raven/contrib/flask/__init__.py @@ -40,7 +40,7 @@ def init_app(self, app): client = self.client_cls( include_paths=app.config.get('SENTRY_INCLUDE_PATHS'), exclude_paths=app.config.get('SENTRY_EXCLUDE_PATHS'), - remote_urls=app.config.get('SENTRY_REMOTE_URLS'), + servers=app.config.get('SENTRY_SERVERS'), name=app.config.get('SENTRY_NAME'), key=app.config.get('SENTRY_KEY'), )