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

bug #597: Tentative solution

(cherry picked from commit 14db7b5f8d0b2ed8224c97920df261bb2b047508)
This commit is contained in:
Tino Vázquez 2011-05-06 14:58:24 +02:00
parent 3c3b2e981e
commit b218c52a17

View File

@ -104,16 +104,15 @@ module OpenNebula
def retrieve_elements(filter)
ids_array = Array.new
if NOKOGIRI
elements=@xml.xpath(filter.to_s)
if elements.size == 0
return nil
end
elements.each{ |e| ids_array << e.text }
if NOKOGIRI
@xml.xpath(filter).each { |pelem|
ids_array << pelem.text
}
else
@xml.each(filter.to_s) { |e| ids_array << e.text }
@xml.elements.each(filter) { |pelem|
ids_array << pelem.text
}
end
return ids_array