capturing wim exceptions properly 64/7364/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 25 Mar 2019 15:00:02 +0000 (15:00 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Mon, 25 Mar 2019 15:00:28 +0000 (15:00 +0000)
Change-Id: I8bb1dde991e416c30acf841d99fdaea3c788eb97
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_ro/nfvo.py

index f6cb847..281b8f9 100644 (file)
@@ -3588,12 +3588,14 @@ def create_instance(mydb, tenant_id, instance_dict):
         returned_instance = mydb.get_instance_scenario(instance_uuid)
         returned_instance["action_id"] = instance_action_id
         return returned_instance
-    except (NfvoException, vimconn.vimconnException, db_base_Exception) as e:
+    except (NfvoException, vimconn.vimconnException, wimconn.WimConnectorError, db_base_Exception) as e:
         message = rollback(mydb, myvims, rollbackList)
         if isinstance(e, db_base_Exception):
             error_text = "database Exception"
         elif isinstance(e, vimconn.vimconnException):
             error_text = "VIM Exception"
+        elif isinstance(e, wimconn.WimConnectorError):
+            error_text = "WIM Exception"
         else:
             error_text = "Exception"
         error_text += " {} {}. {}".format(type(e).__name__, str(e), message)