zaqar/marconi/proxy/transport/base.py
Alejandro Cabrera 08c639019c proxy: mirror structure of marconi queues + bootstrap
This patch adds smarter configuration to the proxy in two steps:

1. mirror the transport implementation used in marconi.queues in
   marconi.proxy
2. add a bootstrap file to take care of start up

Rationale: make configuration work, make deploying easy, make
alternate transport implementations feasible.

Another change: the unit tests are fixed by adding a few changes:
1. add drop functionality to the proxy storage interface
2. use drop/flush in test suite tearDown
3. rm tests.unit.test_config
4. delete queues at the end of the catalogue test (not yet robust)

The rationale for (3) was that test_config did not play nice with
other tests when they were registering their options, and failed as a
result. Furthermore, we should not need to test oslo.config.

Configuration changes: new fields in etc/marconi.conf
- drivers:proxy
- drivers:proxy:storage:{memory.mongodb}
- drivers:proxy:transport:wsgi
- oslo_cache

Also, fix: InternalServerError -> HTTPInternalServerError

Finally, redis was removed from requirements.txt.

Change-Id: If2365a1a738a3975fe6bde7bd07dfdee3460cecd
Implements: blueprint placement-service
2013-10-01 17:11:25 -04:00

38 lines
1.1 KiB
Python

# Copyright (c) 2013 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class DriverBase(object):
"""Base class for Proxy Transport Drivers to document the expected
interface.
:param storage: The storage driver
:param cache: The cache driver
"""
def __init__(self, storage, cache):
self.storage = storage
self.cache = cache
@abc.abstractmethod
def listen():
"""Start listening for client requests (self-hosting mode)."""
raise NotImplementedError