Merge "Restoring the ability to run fake mode locally."
This commit is contained in:
commit
21e3f0b288
@ -47,6 +47,8 @@ extra_opts = [
|
||||
dest='fork'),
|
||||
openstack_cfg.StrOpt('pid-file',
|
||||
default='.pid'),
|
||||
openstack_cfg.StrOpt('override-logfile',
|
||||
default=None),
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
@ -56,8 +58,11 @@ CONF.register_cli_opts(extra_opts)
|
||||
def run_server():
|
||||
try:
|
||||
get_db_api().configure_db(CONF)
|
||||
server = wsgi.WSGIService('reddwarf', CONF.bind_port or 8779)
|
||||
launcher = service.launch(server)
|
||||
conf_file = CONF.find_file(CONF.api_paste_config)
|
||||
launcher = wsgi.launch('reddwarf', CONF.bind_port or 8779, conf_file)
|
||||
|
||||
|
||||
|
||||
launcher.wait()
|
||||
except RuntimeError as error:
|
||||
import traceback
|
||||
@ -67,6 +72,10 @@ def run_server():
|
||||
|
||||
if __name__ == '__main__':
|
||||
cfg.parse_args(sys.argv)
|
||||
if CONF.override_logfile:
|
||||
CONF.use_stderr = False
|
||||
CONF.log_file = CONF.override_logfile
|
||||
|
||||
logging.setup(None)
|
||||
|
||||
if CONF.fork:
|
||||
|
@ -14,5 +14,5 @@ run bin/reddwarf-manage \
|
||||
reddwarf_test.sqlite mysql fake
|
||||
run bin/reddwarf-server \
|
||||
--fork --config-file=etc/reddwarf/reddwarf.conf.test \
|
||||
repo_path=reddwarf_test.sqlite $@
|
||||
$@
|
||||
|
||||
|
42
etc/reddwarf/api-paste.ini.test
Normal file
42
etc/reddwarf/api-paste.ini.test
Normal file
@ -0,0 +1,42 @@
|
||||
[composite:reddwarf]
|
||||
use = call:reddwarf.common.wsgi:versioned_urlmap
|
||||
/: versions
|
||||
/v1.0: reddwarfapi
|
||||
|
||||
[app:versions]
|
||||
paste.app_factory = reddwarf.versions:app_factory
|
||||
|
||||
[pipeline:reddwarfapi]
|
||||
pipeline = faultwrapper tokenauth authorization contextwrapper extensions reddwarfapp
|
||||
#pipeline = debug extensions reddwarfapp
|
||||
|
||||
[filter:extensions]
|
||||
paste.filter_factory = reddwarf.common.extensions:factory
|
||||
|
||||
[filter:tokenauth]
|
||||
paste.filter_factory = reddwarf.tests.fakes.keystone:filter_factory
|
||||
service_protocol = http
|
||||
service_host = 127.0.0.1
|
||||
service_port = 5000
|
||||
auth_host = 127.0.0.1
|
||||
auth_port = 35357
|
||||
auth_protocol = http
|
||||
auth_uri = http://127.0.0.1:5000/
|
||||
admin_token = be19c524ddc92109a224
|
||||
signing_dir = /tmp/keystone-signing-reddwarf
|
||||
|
||||
[filter:authorization]
|
||||
paste.filter_factory = reddwarf.common.auth:AuthorizationMiddleware.factory
|
||||
|
||||
[filter:contextwrapper]
|
||||
paste.filter_factory = reddwarf.common.wsgi:ContextMiddleware.factory
|
||||
|
||||
[filter:faultwrapper]
|
||||
paste.filter_factory = reddwarf.common.wsgi:FaultWrapper.factory
|
||||
|
||||
[app:reddwarfapp]
|
||||
paste.app_factory = reddwarf.common.api:app_factory
|
||||
|
||||
#Add this filter to log request and response for debugging
|
||||
[filter:debug]
|
||||
paste.filter_factory = reddwarf.common.wsgi:Debug
|
@ -97,6 +97,8 @@ notifier_queue_port = 5672
|
||||
notifier_queue_virtual_host = /
|
||||
notifier_queue_transport = memory
|
||||
|
||||
api_paste_config=api-paste.ini.test
|
||||
|
||||
[composite:reddwarf]
|
||||
use = call:reddwarf.common.wsgi:versioned_urlmap
|
||||
/: versions
|
||||
@ -141,3 +143,4 @@ paste.app_factory = reddwarf.common.api:app_factory
|
||||
#Add this filter to log request and response for debugging
|
||||
[filter:debug]
|
||||
paste.filter_factory = reddwarf.common.wsgi:Debug
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user