Fix the example webhook middleware
Change-Id: I242dc8bc655a1d1243c2d4bd51fc62e4dcadc67b
This commit is contained in:
@@ -77,9 +77,8 @@ presented below::
|
|||||||
from swift.common.http import is_success
|
from swift.common.http import is_success
|
||||||
from swift.common.swob import wsgify
|
from swift.common.swob import wsgify
|
||||||
from swift.common.utils import split_path, get_logger
|
from swift.common.utils import split_path, get_logger
|
||||||
from swift.common.request_helper import get_sys_meta_prefix
|
from swift.common.request_helpers import get_sys_meta_prefix
|
||||||
from swift.proxy.controllers.base import get_container_info
|
from swift.proxy.controllers.base import get_container_info
|
||||||
|
|
||||||
from eventlet import Timeout
|
from eventlet import Timeout
|
||||||
import six
|
import six
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
@@ -92,7 +91,6 @@ presented below::
|
|||||||
|
|
||||||
|
|
||||||
class WebhookMiddleware(object):
|
class WebhookMiddleware(object):
|
||||||
|
|
||||||
def __init__(self, app, conf):
|
def __init__(self, app, conf):
|
||||||
self.app = app
|
self.app = app
|
||||||
self.logger = get_logger(conf, log_route='webhook')
|
self.logger = get_logger(conf, log_route='webhook')
|
||||||
@@ -141,8 +139,9 @@ presented below::
|
|||||||
def webhook_factory(global_conf, **local_conf):
|
def webhook_factory(global_conf, **local_conf):
|
||||||
conf = global_conf.copy()
|
conf = global_conf.copy()
|
||||||
conf.update(local_conf)
|
conf.update(local_conf)
|
||||||
def webhook_filter(app, conf):
|
|
||||||
return WebhookMiddleware(app)
|
def webhook_filter(app):
|
||||||
|
return WebhookMiddleware(app, conf)
|
||||||
return webhook_filter
|
return webhook_filter
|
||||||
|
|
||||||
In practice this middleware will call the URL stored on the container as
|
In practice this middleware will call the URL stored on the container as
|
||||||
|
Reference in New Issue
Block a user