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