Switch to setuptools entry points
This commit is contained in:
parent
74242c2776
commit
eef833ce30
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env python2
|
||||
|
||||
import ironic_discoverd.__main__
|
|
@ -50,15 +50,17 @@ def periodic_update():
|
|||
eventlet.greenthread.sleep(15)
|
||||
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
sys.exit("Usage: %s config-file" % sys.argv[0])
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
sys.exit("Usage: %s config-file" % sys.argv[0])
|
||||
|
||||
discoverd.CONF.read(sys.argv[1])
|
||||
debug = discoverd.CONF.getboolean('discoverd', 'debug')
|
||||
discoverd.CONF.read(sys.argv[1])
|
||||
debug = discoverd.CONF.getboolean('discoverd', 'debug')
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG if debug else logging.INFO)
|
||||
discoverd.Firewall.init()
|
||||
eventlet.greenthread.spawn_n(periodic_update)
|
||||
logging.basicConfig(level=logging.DEBUG if debug else logging.INFO)
|
||||
discoverd.Firewall.init()
|
||||
eventlet.greenthread.spawn_n(periodic_update)
|
||||
|
||||
app.run(debug=debug, host=discoverd.CONF.get('discoverd', 'listen_address'),
|
||||
port=discoverd.CONF.getint('discoverd', 'listen_port'))
|
||||
app.run(debug=debug,
|
||||
host=discoverd.CONF.get('discoverd', 'listen_address'),
|
||||
port=discoverd.CONF.getint('discoverd', 'listen_port'))
|
4
setup.py
4
setup.py
|
@ -8,8 +8,8 @@ setup(
|
|||
author = "Dmitry Tantsur",
|
||||
author_email = "dtansur@redhat.com",
|
||||
url = "https://github.com/Divius/ironic-discoverd/",
|
||||
packages=['ironic_discoverd'],
|
||||
packages = ['ironic_discoverd'],
|
||||
install_requires = ['Flask', 'python-ironicclient', 'eventlet',
|
||||
'python-keystoneclient'],
|
||||
scripts = ['bin/ironic-discoverd'],
|
||||
entry_points = {'console_scripts': ["ironic-discoverd = ironic_discoverd.main:main"]},
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue