Use entrypoints for zuul-server.

If we put the code for zuul-server into the zuul module, then autodoc
will pick it up for documentation.

Change-Id: Idf2db82f706243c6e69984170b4783f1eece2237
Reviewed-on: https://review.openstack.org/16850
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Monty Taylor 2012-11-25 12:12:28 -08:00 committed by Jenkins
parent 2747501dee
commit 7df9e7ffe1
4 changed files with 11 additions and 7 deletions

View File

@ -35,7 +35,6 @@ setuptools.setup(
cmdclass=setup.get_cmdclass(),
install_requires=requires,
dependency_links=depend_links,
scripts=['zuul-server'],
zip_safe=False,
classifiers=[
'Environment :: Console',
@ -44,5 +43,10 @@ setuptools.setup(
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python'
]
],
entry_points={
'console_scripts': [
'zuul-server=zuul.cmd.server:main',
],
}
)

View File

@ -18,7 +18,7 @@ setenv = NOSE_WITH_COVERAGE=1
[testenv:pyflakes]
deps = pyflakes
commands = pyflakes zuul zuul-server setup.py
commands = pyflakes zuul setup.py
[testenv:venv]
commands = {posargs}

0
zuul/cmd/__init__.py Normal file
View File

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@ -107,7 +106,8 @@ class Server(object):
print "Ctrl + C: asking scheduler to exit nicely...\n"
self.exit_handler(signal.SIGINT, None)
if __name__ == '__main__':
def main():
server = Server()
server.parse_arguments()
server.read_config()