1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

B #3308: Extended info conf attribute (#3325)

New Sunstone attribute to pull extended pool info from oned

Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
(cherry picked from commit 20fc6d29b0b518f608fd7dc42f36de0d3ef92586)
This commit is contained in:
Jorge Lobo 2019-05-10 18:52:41 +02:00 committed by Tino Vazquez
parent a0c46ae584
commit 11b23c432b
No known key found for this signature in database
GPG Key ID: 2FE9C32E94AEABBE
2 changed files with 13 additions and 2 deletions

View File

@ -50,6 +50,13 @@ module OpenNebula
@user_id = user_id
end
# Get info extended VM
def get_hash_extended
rc = info_search(:extended => true)
return rc if OpenNebula.is_error?(rc)
to_hash
end
# Default Factory Method for the Pools
def factory(element_xml)
OpenNebula::VirtualMachine.new(element_xml,@client)

View File

@ -65,8 +65,12 @@ class SunstoneServer < CloudServer
error = Error.new("Error: #{kind} resource not supported")
return [404, error.to_json]
end
rc = pool.get_hash
if kind == "vm" && $conf[:get_extended_vm_info]
rc = pool.get_hash_extended
else
rc = pool.get_hash
end
if OpenNebula.is_error?(rc)
return [500, rc.to_json]