X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Flcm.py;h=10156d317c1f5715e0d8d9284e34e605a44366b2;hb=refs%2Fchanges%2F77%2F8577%2F1;hp=8cd15e8348f64455611c208b276547a49526aab7;hpb=2f033e6e63b1886b9bd33abeee4a3b7bbfc31808;p=osm%2FLCM.git diff --git a/osm_lcm/lcm.py b/osm_lcm/lcm.py index 8cd15e8..10156d3 100644 --- a/osm_lcm/lcm.py +++ b/osm_lcm/lcm.py @@ -286,6 +286,10 @@ class Lcm: except Exception as e: self.logger.error("Cannot write into '{}' for healthcheck: {}".format(health_check_file, e)) return + elif topic == "pla": + if command == "placement": + self.ns.update_nsrs_with_pla_result(params) + return elif topic == "k8scluster": if command == "create" or command == "created": k8scluster_id = params.get("_id") @@ -463,7 +467,7 @@ class Lcm: self.first_start = True while self.consecutive_errors < 10: try: - topics = ("ns", "vim_account", "wim_account", "sdn", "nsi", "k8scluster", "k8srepo") + topics = ("ns", "vim_account", "wim_account", "sdn", "nsi", "k8scluster", "k8srepo", "pla") topics_admin = ("admin", ) await asyncio.gather( self.msg.aioread(topics, self.loop, self.kafka_read_callback), @@ -612,7 +616,7 @@ def health_check(): with open(health_check_file, "r") as f: last_received_ping = f.read() - if time() - float(last_received_ping) < Lcm.ping_interval_pace + 10: + if time() - float(last_received_ping) < 2 * Lcm.ping_interval_pace: # allow one ping not received every two exit(0) except Exception: pass @@ -624,7 +628,7 @@ def health_check(): if __name__ == '__main__': try: - print("SYS.PATH='{}'".format(sys.path)) + # print("SYS.PATH='{}'".format(sys.path)) # load parameters and configuration # -h # -c value