mirror of
https://github.com/OpenNebula/one.git
synced 2025-08-29 09:49:28 +03:00
bug #597: Tentative solution
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user