Skip to content

Commit

Permalink
Fixes bug 948533 - All services should accept any number of keyword a…
Browse files Browse the repository at this point in the history
…rguments.
  • Loading branch information
adngdb committed Feb 21, 2014
1 parent 73b6197 commit 89606a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 3 additions & 1 deletion socorro/external/elasticsearch/supersearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def process_filter_missing(self, key, value, action):

class SuperSearch(SearchBase, ElasticSearchBase):

def __init__(self, config):
def __init__(self, *args, **kwargs):
config = kwargs.get('config')

# We have multiple inheritance here, explicitly calling superclasses's
# init is mandatory.
# See http://freshfoo.com/blog/object__init__takes_no_parameters
Expand Down
11 changes: 3 additions & 8 deletions socorro/external/rabbitmq/priorityjobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import logging

from configman.dotdict import DotDictWithAcquisition
import pika
from pika.exceptions import ChannelClosed

from socorro.external import MissingArgumentError
from socorro.external.rabbitmq.connection_context import (Connection,
ConnectionContext)
from socorro.lib import external_common


class Priorityjobs(object):
"""Implement the /priorityjobs service with RabbitMQ."""

def __init__(self, config, all_services=None):
self.config = config.rabbitmq
def __init__(self, *args, **kwargs):
self.config = kwargs.get('config').rabbitmq
self.context = self.config.rabbitmq_class(self.config)

def get(self, **kwargs):
Expand Down Expand Up @@ -55,4 +51,3 @@ def create(self, **kwargs):
return False

return True

2 changes: 1 addition & 1 deletion socorro/unittest/external/elasticsearch/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def setUp(self):

config = self.get_config_context()
self.storage = crashstorage.ElasticSearchCrashStorage(config)
self.api = SuperSearch(config)
self.api = SuperSearch(config=config)

# clear the indices cache so the index is created on every test
self.storage.indices_cache = set()
Expand Down
6 changes: 3 additions & 3 deletions socorro/unittest/external/elasticsearch/test_supersearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestSuperSearch(ElasticSearchTestCase):

def test_get_indexes(self):
config = self.get_config_context()
api = SuperSearch(config)
api = SuperSearch(config=config)

now = datetime.datetime(2000, 2, 1, 0, 0)
lastweek = now - datetime.timedelta(weeks=1)
Expand All @@ -40,7 +40,7 @@ def test_get_indexes(self):
self.assertEqual(res, ['socorro_integration_test'])

config = self.get_config_context(es_index='socorro_%Y%W')
api = SuperSearch(config)
api = SuperSearch(config=config)

dates = [
search_common.SearchParam('date', now, '<'),
Expand Down Expand Up @@ -74,7 +74,7 @@ def setUp(self):
super(IntegrationTestSuperSearch, self).setUp()

config = self.get_config_context()
self.api = SuperSearch(config)
self.api = SuperSearch(config=config)
self.storage = crashstorage.ElasticSearchCrashStorage(config)

# clear the indices cache so the index is created on every test
Expand Down

0 comments on commit 89606a2

Please sign in to comment.