]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Revert "Add a new puppet face"
authorStephen Gran <steve@lobefin.net>
Fri, 3 Jan 2014 15:01:53 +0000 (15:01 +0000)
committerStephen Gran <steve@lobefin.net>
Fri, 3 Jan 2014 15:01:53 +0000 (15:01 +0000)
This reverts commit b75862abf9f8001f671f5fc603ffcfb981797231.

modules/parselocalconfig/lib/puppet/face/catalog/print.rb [deleted file]

diff --git a/modules/parselocalconfig/lib/puppet/face/catalog/print.rb b/modules/parselocalconfig/lib/puppet/face/catalog/print.rb
deleted file mode 100644 (file)
index f8ec4c9..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-require 'puppet/face'
-
-Puppet::Face.define(:catalog, '0.0.1') do
-  action :print do
-    summary "Displays the contents of a catalog"
-
-    option "--catalog CATALOG" do
-      summary "Path to a specific catalog to print"
-    end
-
-    option "--limit TYPE" do
-      summary "Limits the display to a certain type"
-    end
-
-    option "--no-classes" do
-      summary "Do not show any classes"
-    end
-
-    option "--no-resources" do
-      summary "Do not show resources list"
-    end
-
-    option "--no-tags" do
-      summary "Do not show any tags"
-    end
-
-
-    when_invoked do |options|
-      Puppet.settings.preferred_run_mode = "agent"
-
-      catalog_file = options.fetch(:catalog, File.join([Puppet[:client_datadir], "catalog", "%s.json" % Puppet[:certname]]))
-
-      catalog = PSON.parse(File.read(catalog_file))
-
-      unless options[:no_classes] == false
-        puts("Classes included on this node:")
-        catalog.classes.each do |klass|
-          puts("\t#{klass}")
-        end
-
-        puts("\n\n")
-      end
-
-      unless options[:no_tags] == false
-        puts("Tags for this node:")
-        catalog.tags.each do |tag|
-          puts("\t#{tag}")
-        end
-
-        puts("\n\n")
-      end
-
-      unless options[:no_resources] == false
-        puts("Resources managed by puppet on this node:")
-        printresource(catalog, options[:limit])
-      end
-
-      nil
-    end
-  end
-
-  def printresource(resource, limit)
-    if resource.class == Puppet::Resource::Catalog
-      resource.edges.each do |b|
-        printresource(b, limit)
-      end
-    elsif resource.class == Puppet::Relationship and resource.target.class == Puppet::Resource and resource.target.title != nil and resource.target.file != nil
-      target = resource.target
-      manifestfile = target.file.gsub("/etc/puppet/manifests/", "")
-
-      if limit
-        if target.type.downcase == limit.downcase
-          puts "\t#{target.type} { #{target.title}: }\n\t\tdefined in #{manifestfile}:#{target.line}\n\n"
-        end
-      else
-          puts "\t#{target.type} { #{target.title}: }\n\t\tdefined in #{manifestfile}:#{target.line}\n\n"
-      end
-    end
-  end
-end