Skip to content

Commit

Permalink
Merge pull request #4 from raphink/dev/filter_local
Browse files Browse the repository at this point in the history
Add a --filter_local option
  • Loading branch information
acidprime committed Jun 2, 2015
2 parents fabf3ec + c78651c commit e864c9b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/puppet/catalog-diff/searchfacts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def find_nodes(options = {})
if active_nodes.empty?
raise "No active nodes were returned from your fact search"
end
found_nodes = yaml_cache.select { |node| active_nodes.include?(node) }
found_nodes
if options[:filter_local]
yaml_cache.select { |node| active_nodes.include?(node) }
else
active_nodes
end
end

def find_nodes_local(fact,value)
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/face/catalog/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
summary 'Do not print classes in resource diffs'
end

option "--filter_local" do
summary "Use local YAML node files to filter out queried nodes"
end

option "--changed_depth=" do
summary "The number of nodes to display sorted by changes"
default_to { "10" }
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/face/catalog/pull.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
summary "Use puppetdb to do the fact search instead of the rest api"
end

option "--filter_local" do
summary "Use local YAML node files to filter out queried nodes"
end

option "--changed_depth=" do
summary "The number of problem files to display sorted by changes"

Expand Down

0 comments on commit e864c9b

Please sign in to comment.