Browse Source

Add an entrypoints to launch oslo.metrics

Change-Id: I0d5fab019f8befb52cd07628006edcb2af8e6473
changes/29/735129/4
Hervé Beraud 1 year ago
parent
commit
a0b0816fe4
  1. 7
      oslo_metrics/__main__.py
  2. 6
      setup.cfg

7
main.py → oslo_metrics/__main__.py

@ -69,7 +69,8 @@ class MetricsListener():
self.socket.close()
self.start = False
if __name__ == "__main__":
def main():
cfg.CONF(sys.argv[1:])
m = MetricsListener(cfg.CONF.oslo_metrics.metrics_socket_file)
mt = threading.Thread(target=m.serve)
@ -87,3 +88,7 @@ if __name__ == "__main__":
os.remove(cfg.CONF.oslo_metrics.metrics_socket_file)
m.stop()
httpd.server_close()
if __name__ == "__main__":
main()

6
setup.cfg

@ -23,4 +23,8 @@ classifier =
[files]
packages =
oslo_metrics
oslo_metrics
[entry_points]
console_scripts =
oslo-metrics = oslo_metrics.__main__:main
Loading…
Cancel
Save