Fixes trove-api daemon fake mode functionality.
This commit adds code to register taskmanager as a fake endpoint. This allows the fake daemon to work again. Fixes bug 1238901 Change-Id: Icb7c97cad3d76dc36a38126eb7f8b5929dc0d591
This commit is contained in:
parent
8f88998d40
commit
eb81a1e963
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,7 +15,7 @@ dist/
|
||||
host-syslog.log
|
||||
tags
|
||||
.tox
|
||||
rdtest.log
|
||||
trovetest.log
|
||||
trove/versioninfo
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
|
@ -12,7 +12,7 @@ function run() {
|
||||
run bin/trove-manage \
|
||||
--config-file=etc/trove/trove.conf.test db_wipe \
|
||||
trove_test.sqlite mysql fake
|
||||
run bin/trove-server \
|
||||
run bin/trove-fake-mode \
|
||||
--fork --config-file=etc/trove/trove.conf.test \
|
||||
$@
|
||||
|
@ -41,6 +41,7 @@ from trove.db import get_db_api
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
cfg.parse_args(sys.argv)
|
||||
logging.setup(None)
|
||||
|
@ -54,13 +54,23 @@ CONF = cfg.CONF
|
||||
CONF.register_cli_opts(extra_opts)
|
||||
|
||||
|
||||
def start_fake_taskmanager():
|
||||
topic = CONF.taskmanager_queue
|
||||
from trove.openstack.common.rpc import service as rpc_service
|
||||
from trove.taskmanager import manager
|
||||
manager_impl = manager.Manager()
|
||||
taskman_service = rpc_service.Service(None, topic=topic,
|
||||
manager=manager_impl)
|
||||
taskman_service.start()
|
||||
|
||||
|
||||
def run_server():
|
||||
try:
|
||||
get_db_api().configure_db(CONF)
|
||||
conf_file = CONF.find_file(CONF.api_paste_config)
|
||||
launcher = wsgi.launch('trove', CONF.bind_port or 8779, conf_file,
|
||||
workers=CONF.trove_api_workers)
|
||||
|
||||
start_fake_taskmanager()
|
||||
launcher.wait()
|
||||
except RuntimeError as error:
|
||||
import traceback
|
||||
@ -68,7 +78,7 @@ def run_server():
|
||||
sys.exit("ERROR: %s" % error)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
cfg.parse_args(sys.argv)
|
||||
if CONF.override_logfile:
|
||||
CONF.use_stderr = False
|
||||
@ -87,3 +97,7 @@ if __name__ == '__main__':
|
||||
f.write(str(pid))
|
||||
else:
|
||||
run_server()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -12,7 +12,7 @@ rpc_backend = trove.common.rpc.impl_fake
|
||||
# This will remove some of the verbose logging when trying to diagnose tox issues
|
||||
default_log_levels=routes.middleware=ERROR,trove.common.auth=WARN
|
||||
|
||||
log_file = rdtest.log
|
||||
log_file = trovetest.log
|
||||
|
||||
use_stderr = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user