mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
bug #597: Tentative solution
This commit is contained in:
1 parent
a07b8e4b1c
commit
14db7b5f8d
1 file changed
+7
-8
@@ -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