From 04111f46deec6d0c5ad0b567453f2cf2bbf17c3a Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Wed, 5 Sep 2018 16:35:50 +0200 Subject: [PATCH] B #2348: Error when creating a vnet from Sunstone using advanced mode (#2380) (cherry picked from commit 3932c7d56de739237d1658279a4dbdc29bad76a9) --- src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb index c1e375e6ec..521bd8818a 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb @@ -27,9 +27,6 @@ module OpenNebulaJSON end cluster_id = parse_json(template_json, 'cluster_id') - if OpenNebula.is_error?(cluster_id) - return cluster_id - end if vnet_hash['vnet_raw'] template = vnet_hash['vnet_raw'] @@ -37,7 +34,9 @@ module OpenNebulaJSON template = template_to_str(vnet_hash) end - self.allocate(template, cluster_id.to_i) + if !OpenNebula.is_error?(cluster_id) + self.allocate(template, cluster_id.to_i) + end end def perform_action(template_json)