From ee9f14f0d3898e8a09ba738abf60a653855ac656 Mon Sep 17 00:00:00 2001 From: Abel Coronado Date: Tue, 16 Oct 2018 10:34:37 +0200 Subject: [PATCH] B #2348: Error when creating a virtual network from Sunstone using advanced mode --- src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb index 521bd8818a..c7db3fe6b5 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb @@ -26,16 +26,17 @@ module OpenNebulaJSON return vnet_hash end - cluster_id = parse_json(template_json, 'cluster_id') - if vnet_hash['vnet_raw'] template = vnet_hash['vnet_raw'] else template = template_to_str(vnet_hash) end + cluster_id = parse_json(template_json, 'cluster_id') if !OpenNebula.is_error?(cluster_id) self.allocate(template, cluster_id.to_i) + else + self.allocate(template) end end