X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=vim_thread.py;h=676ba207e28f881f4825c2a3be0d2a055466f03d;hb=ac1e379bcb9d68731df3b988cb622f69468d904a;hp=d89c4d141af69984ed3838c01aa734682968a855;hpb=3fbff9b6666ea4981e953c98d236b54fb86c583b;p=osm%2FRO.git diff --git a/vim_thread.py b/vim_thread.py index d89c4d14..676ba207 100644 --- a/vim_thread.py +++ b/vim_thread.py @@ -34,7 +34,7 @@ import Queue import logging import vimconn from db_base import db_base_Exception -from openvim.ovim import ovimException +#from openvim.ovim import ovimException # from logging import Logger @@ -159,13 +159,14 @@ class vim_thread(threading.Thread): net_type = params[1] network = None - sdn_controller = self.vim.config.get('sdn-controller') + #sdn_controller = self.vim.config.get('sdn-controller') + sdn_controller = None if sdn_controller and (net_type == "data" or net_type == "ptp"): network = {"name": net_name, "type": net_type} vim_net = self.vim.get_network(net_id) - if vim_net.get('network_type') != 'vlan': - raise vimconn.vimconnException(net_name + "defined as type " + net_type + " but the created network in vim is " + vim_net['provider:network_type']) + if vim_net.get('encapsulation') != 'vlan': + raise vimconn.vimconnException(net_name + "defined as type " + net_type + " but the created network in vim is " + vim_net['encapsulation']) network["vlan"] = vim_net.get('segmentation_id') @@ -189,9 +190,9 @@ class vim_thread(threading.Thread): except db_base_Exception as e: self.logger.error("Error updating database %s", str(e)) return False, str(e) - except ovimException as e: - self.logger.error("Error creating NET in ovim, task=%s: %s", str(task_id), str(e)) - return False, str(e) + # except ovimException as e: + # self.logger.error("Error creating NET in ovim, task=%s: %s", str(task_id), str(e)) + # return False, str(e) def new_vm(self, task): try: @@ -252,7 +253,8 @@ class vim_thread(threading.Thread): def del_net(self, task): net_id = task["params"][0] - sdn_net_id = task["params"][1] + #sdn_net_id = task["params"][1] + sdn_net_id = None if is_task_id(net_id): try: task_create = task["depends"][net_id] @@ -272,8 +274,7 @@ class vim_thread(threading.Thread): return True, result except vimconn.vimconnException as e: return False, str(e) - except ovimException as e: - logging.error("Error deleting network from ovim. net_id: {}, sdn_net_id: {}".format(net_id, sdn_net_id)) - return False, str(e) - + # except ovimException as e: + # logging.error("Error deleting network from ovim. net_id: {}, sdn_net_id: {}".format(net_id, sdn_net_id)) + # return False, str(e)