Commit 010718b0 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

ui: Network creation rollback on subnet creation failure

do a destroy call on created network if associated subnet creation call
fails for some reason.
parent 26992230
...@@ -295,7 +295,11 @@ ...@@ -295,7 +295,11 @@
var network = resp.network; var network = resp.network;
subnet_params.subnet.network_id = network.id; subnet_params.subnet.network_id = network.id;
synnefo.storage.subnets.create(subnet_params, { synnefo.storage.subnets.create(subnet_params, {
complete: function () { cb && cb() } complete: function () { cb && cb() },
error: function() {
var created_network = new synnefo.models.networks.Network({id: network.id});
created_network.destroy({no_skip: true});
}
}); });
quota.get('cyclades.network.private').increase(); quota.get('cyclades.network.private').increase();
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment