Fixing zero element pool listing

git-svn-id: http://svn.opennebula.org/one/trunk@812 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Constantino Vázquez Blanco committed 2009-10-05 17:06:56 +00:00
1 parent 6e7574753d
commit e32ecf7727
2 files changed
+15 -10

No files matched your search

+8 -5
View File
@@ -9,12 +9,15 @@ class VirtualMachinePoolOCCI < VirtualMachinePool
pool_hash=Crack::XML.parse(to_xml)
occi_xml = "<COMPUTES>"
vmlist=[pool_hash['VM_POOL']['VM']].flatten
if pool_hash['VM_POOL'] != nil
vmlist=[pool_hash['VM_POOL']['VM']].flatten
vmlist.each{|vm|
occi_xml+='<COMPUTE ' + 'href="' +
base_url + '/compute/' + vm['ID'].strip + '"/>'
}
end
vmlist.each{|vm|
occi_xml+='<COMPUTE ' + 'href="' +
base_url + '/compute/' + vm['ID'].strip + '"/>'
}
occi_xml += "</COMPUTES>"
end
end
+7 -5
View File
@@ -9,12 +9,14 @@ class VirtualNetworkPoolOCCI < VirtualNetworkPool
network_pool_hash=Crack::XML.parse(to_xml)
occi_xml = "<NETWORK>"
vnlist=[pool_hash['VNET_POOL']['VNET']].flatten
if network_pool_hash['VM_POOL'] != nil
vnlist=[network_pool_hash['VNET_POOL']['VNET']].flatten
vnlist.each{|network|
occi_xml+='<NIC ' + 'href="' +
base_url + '/network/' + network['ID'].strip + '"/>'
}
vnlist.each{|network|
occi_xml+='<NIC ' + 'href="' +
base_url + '/network/' + network['ID'].strip + '"/>'
}
end
occi_xml += "</NETWORK>"
end