From: Benjamin Diaz Date: Wed, 17 Oct 2018 16:20:16 +0000 (-0300) Subject: Aodh notifier now uses port defined in OS_NOTIFIER_URI X-Git-Tag: v5.0.0~21 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=2aec92e1eb52d5512c2acae9ce9878f2f3c8f782;hp=8280121bd3684354e83cd43eb91ad616405e2e8d;p=osm%2FMON.git Aodh notifier now uses port defined in OS_NOTIFIER_URI Aodh notifier was using always port 8662, instead of getting the port defined in config. That has been fixed. Signed-off-by: Benjamin Diaz --- diff --git a/osm_mon/plugins/OpenStack/Aodh/notifier.py b/osm_mon/plugins/OpenStack/Aodh/notifier.py index a1c85e6..b63e581 100644 --- a/osm_mon/plugins/OpenStack/Aodh/notifier.py +++ b/osm_mon/plugins/OpenStack/Aodh/notifier.py @@ -25,6 +25,7 @@ import json import logging import os +import re import sys import time @@ -138,10 +139,11 @@ def run(server_class=HTTPServer, handler_class=NotifierHandler, port=8662): if __name__ == "__main__": - from sys import argv - - # Runs the webserver - if len(argv) == 2: - run(port=int(argv[1])) + cfg = Config.instance() + p = re.compile(':(\d+)', re.IGNORECASE) + m = p.search(cfg.OS_NOTIFIER_URI) + if m: + port = m.group(1) + run(port=int(port)) else: run()