Make senlin-api a console script entry point
Make senlin-api a console script entry point, delete senlin-api and senlin-manage from bin/ folder. Change-Id: I7f047b80ccec76563e9477aaaa323f76d60ad185
This commit is contained in:
parent
33ea13553f
commit
7a90e06ace
|
@ -1,29 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
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 senlin.cmd import manage
|
||||
|
||||
manage.main()
|
|
@ -0,0 +1,17 @@
|
|||
# All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import eventlet
|
||||
|
||||
eventlet.monkey_patch(os=False)
|
|
@ -15,21 +15,8 @@
|
|||
"""
|
||||
Senlin API Server.
|
||||
"""
|
||||
|
||||
import eventlet
|
||||
eventlet.monkey_patch(os=False)
|
||||
|
||||
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
|
||||
|
@ -46,7 +33,8 @@ _lazy.enable_lazy()
|
|||
|
||||
LOG = logging.getLogger('senlin.api')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
def main():
|
||||
try:
|
||||
logging.register_options(cfg.CONF)
|
||||
cfg.CONF(project='senlin', prog='senlin-api',
|
|
@ -23,11 +23,11 @@ classifier =
|
|||
packages =
|
||||
senlin
|
||||
scripts =
|
||||
bin/senlin-api
|
||||
bin/senlin-engine
|
||||
|
||||
[entry_points]
|
||||
console_scripts =
|
||||
senlin-api = senlin.cmd.api:main
|
||||
senlin-manage = senlin.cmd.manage:main
|
||||
|
||||
oslo.config.opts =
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -44,7 +44,7 @@ commands = oslo_debug_helper {posargs}
|
|||
|
||||
[testenv:pep8]
|
||||
commands =
|
||||
flake8 senlin bin/senlin-api bin/senlin-engine bin/senlin-manage
|
||||
flake8 senlin bin/senlin-engine
|
||||
# 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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue