Commit 43fa819d authored by bne86's avatar bne86

change license, some ci stuff, update requirements, some skeleton stuff.

parent 1e0e9057
Pipeline #1098 passed with stage
in 14 seconds
......@@ -3,7 +3,9 @@ python_2:
before_script:
- pip install -r testing_requirements.txt
script:
- find . -name "*.py" -exec pep8 {} \;
- find messagebus -name "*.py" -exec pep8 {} \;
- find messagebus -name "*.py" -exec pep257 {} \;
- nosetests --with-coverage --cover-package=messagebus
- radon mi .
- radon cc .
......@@ -12,6 +14,8 @@ python_3:
before_script:
- pip install -r testing_requirements.txt
script:
- find . -name "*.py" -exec pep8 {} \;
- find messagebus -name "*.py" -exec pep8 {} \;
- find messagebus -name "*.py" -exec pep257 {} \;
- nosetests --with-coverage --cover-package=messagebus
- radon mi .
- radon cc .
This diff is collapsed.
"""python package that enables message bus support for a swift proxy."""
\ No newline at end of file
"""clients for several message bus system in here."""
\ No newline at end of file
"""maybe we will have dependency injection for clients later."""
#from .clients.kafka import
"""actual swift proxy middleware that sends information to message bus."""
#from .messagebus_client import ...
from swift.common.utils import config_true_value, get_logger, split_path
from swift.proxy.controllers.base import get_object_info
from webob import Request, Response
class MessagebusMiddleware(object):
"""Middleware that sends information to message bus for every request."""
def __init__(self, app, conf=None, logger=None):
"""construct."""
self.app = app
if conf:
self.conf = conf
else:
conf = {}
if logger:
self.logger = logger
else:
self.logger = get_logger(conf=conf,
log_route='messagebus',
log_to_console=False)
def __call__(self, env, start_response):
"""plug into the call.
:param env: request environment
:param start_response: function that we call when creating response
:return:
"""
self.start_response = start_response
request = Request(env)
return self.app(env, start_response)
def filter_factory(global_config, **local_conf):
"""Return a WSGI filter app for use with paste.deploy.
:param global_config: global config
:param local_conf: local config
:return: PersistentIdentifierMiddleware
"""
conf = global_config.copy()
conf.update(local_conf)
def messagebus(app):
return MessagebusMiddleware(app, conf)
return messagebus
[pipeline:main]
pipeline = healthcheck authtoken keystoneauth messagebus proxy-server
[filter:messagebus]
use = egg:messagebus#messagebus_middleware
url =
username =
password =
\ No newline at end of file
requests>=2.7.0
paste
WebOb
\ No newline at end of file
from setuptools import find_packages, setup
version = '0.1'
setup(
name='messagebus',
version='0.1',
description='''
implements a paste middleware that sends (metadata) information
to a message bus''',
long_description='''
This provides a python middleware distributed via egg which can be
added to the OpenStack Swift pipeline to add message bus functionality
''',
classifiers=[
'Programming Language :: Python'
],
keywords='',
author='bne',
author_email='b.von.st.vieth@fz-juelich.de',
include_package_data=True,
packages=find_packages(),
zip_safe=False,
install_requires=[
'setuptools',
'requests>=2.7.0',
'paste',
'WebOb'
],
entry_points={
'paste.filter_factory': ['messagebus = '
'messagebus.'
'messagebus_middleware:'
'filter_factory'],
}
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment