Make senlin-engine a console script entry point

Make senlin-engine a console script entry point, and delete
senlin-engine from bin/ folder.

Change-Id: If2ab488374ad5ad01f7f146e8b361e422abbf241
This commit is contained in:
Ethan Lynn 2016-01-14 16:07:45 +08:00
parent 23fbbfcd65
commit 19083c8c98
3 changed files with 4 additions and 19 deletions

18
bin/senlin-engine → senlin/cmd/engine.py Executable file → Normal file
View File

@ -15,21 +15,6 @@
"""
Senlin Engine Server.
"""
import eventlet
eventlet.monkey_patch()
import os
import sys
# If ../senlin/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
POSSIBLE_TOPDIR = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'senlin', '__init__.py')):
sys.path.insert(0, POSSIBLE_TOPDIR)
from oslo_config import cfg
from oslo_i18n import _lazy
from oslo_log import log as logging
@ -42,7 +27,8 @@ _lazy.enable_lazy()
LOG = logging.getLogger('senlin.engine')
if __name__ == '__main__':
def main():
logging.register_options(cfg.CONF)
cfg.CONF(project='senlin', prog='senlin-engine')
logging.setup(cfg.CONF, 'senlin-engine')

View File

@ -22,12 +22,11 @@ classifier =
[files]
packages =
senlin
scripts =
bin/senlin-engine
[entry_points]
console_scripts =
senlin-api = senlin.cmd.api:main
senlin-engine = senlin.cmd.engine:main
senlin-manage = senlin.cmd.manage:main
oslo.config.opts =

View File

@ -44,7 +44,7 @@ commands = oslo_debug_helper {posargs}
[testenv:pep8]
commands =
flake8 senlin bin/senlin-engine
flake8 senlin
# Check that .po and .pot files are valid:
bash -c "find senlin -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"