X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=RO%2Fosm_ro%2Fvim_thread.py;h=23dcdb724ba6d176947b25611c427a94a8b10f26;hb=d236104d05b816080a88c30d9986b03395a5f371;hp=e7bf8914691e21bddb8ee83ba02fc16692d34836;hpb=0436bb46f52a213b7f4ba51344d51306208c28ee;p=osm%2FRO.git diff --git a/RO/osm_ro/vim_thread.py b/RO/osm_ro/vim_thread.py index e7bf8914..23dcdb72 100644 --- a/RO/osm_ro/vim_thread.py +++ b/RO/osm_ro/vim_thread.py @@ -224,9 +224,9 @@ class vim_thread(threading.Thread): self.wim_account_id, self.plugin_name)) except Exception as e: self.logger.error("Cannot load sdn connector for wim_account={}, plugin={}: {}".format( - self.wim_account_id, self.plugin_name, e)) + self.wim_account_id, self.plugin_name, e), exc_info=True) self.sdnconnector = None - self.error_status = "Error loading sdn connector: {}".format(e) + self.error_status = self._format_vim_error_msg("Error loading sdn connector: {}".format(e)) def _get_db_task(self): """ @@ -723,7 +723,8 @@ class vim_thread(threading.Thread): self.logger.error("Error executing task={}: {}".format(task_id, e), exc_info=True) task["error_msg"] = str(e) task["status"] = "FAILED" - database_update = {"status": "VIM_ERROR", "error_msg": task["error_msg"]} + database_update = {"status": "VIM_ERROR" if task["item"] != "instance_wim_nets" else "WIM_ERROR", + "error_msg": task["error_msg"]} # if task["item"] == 'instance_vms': # database_update["vim_vm_id"] = None # elif task["item"] == 'instance_nets': @@ -810,10 +811,9 @@ class vim_thread(threading.Thread): return False def run(self): - self.logger.debug("Starting") + self.logger.info("Starting") while True: self.get_vim_sdn_connector() - self.logger.debug("Vimconnector loaded") reload_thread = False while True: @@ -1462,10 +1462,10 @@ class vim_thread(threading.Thread): if '/' not in source_ip: source_ip += '/32' definition["source_ip_prefix"] = source_ip - if source_port: + if source_port and ip_proto !='icmp': definition["source_port_range_min"] = source_port definition["source_port_range_max"] = source_port - if destination_port: + if destination_port and ip_proto !='icmp': definition["destination_port_range_min"] = destination_port definition["destination_port_range_max"] = destination_port if destination_ip: