Remove rollback logic of vnf instantiate
authorfujinhua <fu.jinhua@zte.com.cn>
Mon, 20 Feb 2017 02:31:19 +0000 (10:31 +0800)
committerfujinhua <fu.jinhua@zte.com.cn>
Mon, 20 Feb 2017 02:31:19 +0000 (10:31 +0800)
Change-Id: Ie49458127442a9443065fedab9ac9dd83e2a4fb7
Issue-Id: GVNFM-30
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
lcm/lcm/pub/vimapi/adaptor.py

index 32905df..4039392 100644 (file)
@@ -38,26 +38,19 @@ OPT_CREATE_VM = 80
 BOOT_FROM_VOLUME = 1
 
 
-def create_vim_res(data, do_notify, do_rollback):
-    try:
-        for vol in ignore_case_get(data, "volume_storages"):
-            create_volume(vol, do_notify, OPT_CREATE_VOLUME)
-        for network in ignore_case_get(data, "vls"):
-            create_network(network, do_notify, OPT_CREATE_NETWORK)
-        for subnet in ignore_case_get(data, "vls"):
-            create_subnet(subnet, do_notify, OPT_CREATE_SUBNET)
-        for port in ignore_case_get(data, "cps"):
-            create_port(port, do_notify, OPT_CREATE_PORT)
-        for flavor in ignore_case_get(data, "vdus"):
-            create_flavor(flavor, do_notify, OPT_CREATE_FLAVOR)
-        for vm in ignore_case_get(data, "vdus"):
-            create_vm(vm, do_notify, OPT_CREATE_VM)
-    except VimException as e:
-        logger.error(e.message)
-        do_rollback(e.message)
-    except:
-        logger.error(traceback.format_exc())
-        do_rollback(str(sys.exc_info()))
+def create_vim_res(data, do_notify):
+    for vol in ignore_case_get(data, "volume_storages"):
+        create_volume(vol, do_notify, OPT_CREATE_VOLUME)
+    for network in ignore_case_get(data, "vls"):
+        create_network(network, do_notify, OPT_CREATE_NETWORK)
+    for subnet in ignore_case_get(data, "vls"):
+        create_subnet(subnet, do_notify, OPT_CREATE_SUBNET)
+    for port in ignore_case_get(data, "cps"):
+        create_port(port, do_notify, OPT_CREATE_PORT)
+    for flavor in ignore_case_get(data, "vdus"):
+        create_flavor(flavor, do_notify, OPT_CREATE_FLAVOR)
+    for vm in ignore_case_get(data, "vdus"):
+        create_vm(vm, do_notify, OPT_CREATE_VM)
 
 def delete_vim_res(data, do_notify):
     res_types = ["vm", "flavor", "port", "subnet", "network", "volume"]