diff --git a/lib/rvc/extensions/VirtualMachine.rb b/lib/rvc/extensions/VirtualMachine.rb index cedb68b..9330ea3 100644 --- a/lib/rvc/extensions/VirtualMachine.rb +++ b/lib/rvc/extensions/VirtualMachine.rb @@ -274,4 +274,18 @@ def display_info puts "state: #{tree.state}" puts "creation time: #{tree.createTime}" end + + def self.traverse? + true + end + + field 'type' do + summary "The type of object" + property 'find_tree.class.to_s' + end + + field 'name' do + summary "The snapshot name." + property 'find_tree.name' + end end diff --git a/lib/rvc/modules/find.rb b/lib/rvc/modules/find.rb index d543e37..5e6568d 100644 --- a/lib/rvc/modules/find.rb +++ b/lib/rvc/modules/find.rb @@ -70,12 +70,11 @@ def leaves roots, types = [] nodes = new_nodes new_nodes = Set.new nodes.each do |node| - if (node.class.traverse? or roots.member? node) and - (types & (node.field('type') || [])).empty? + if (node.class.traverse? or roots.member? node) node.children.each { |k,v| v.rvc_link(node, k); new_nodes << v } - else - leaves << node end + + leaves << node end end leaves