Minor changes. sdn_net_id variable not set 16/1516/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 6 Apr 2017 12:25:39 +0000 (14:25 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 6 Apr 2017 12:30:22 +0000 (13:30 +0100)
Change-Id: I0068acdb33deaaba4bad6e6d16cf22b0fba461f2
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
vim_thread.py

index 1b518d3..3c35d6c 100644 (file)
@@ -397,6 +397,7 @@ class vim_thread(threading.Thread):
             net_type = params[1]
 
             network = None
+            sdn_net_id = None
             sdn_controller = self.vim.config.get('sdn-controller')
             if sdn_controller and (net_type == "data" or net_type == "ptp"):
                 network = {"name": net_name, "type": net_type}
@@ -407,7 +408,6 @@ class vim_thread(threading.Thread):
                         "net '{}' defined as type '{}' has not vlan encapsulation '{}'".format(
                             net_name, net_type, vim_net['encapsulation']))
                 network["vlan"] = vim_net.get('segmentation_id')
-                sdn_net_id = None
                 try:
                     sdn_net_id = self.ovim.new_network(network)
                 except (ovimException, Exception) as e: