403Webshell
Server IP : 66.29.132.122  /  Your IP : 18.218.171.212
Web Server : LiteSpeed
System : Linux business142.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : admazpex ( 531)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/face/catalog/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/proc/self/root/proc/thread-self/root/proc/thread-self/root/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/face/catalog/select.rb
# Select and show a list of resources of a given type.
Puppet::Face.define(:catalog, '0.0.1') do
  action :select do
    summary _("Retrieve a catalog and filter it for resources of a given type.")
    arguments _("<host> <resource_type>")
    returns _(<<-'EOT')
      A list of resource references ("Type[title]"). When used from the API,
      returns an array of Puppet::Resource objects excised from a catalog.
    EOT
    description <<-'EOT'
      Retrieves a catalog for the specified host, then searches it for all
      resources of the requested type.
    EOT
    notes <<-'NOTES'
      By default, this action will retrieve a catalog from Puppet's compiler
      subsystem; you must call the action with `--terminus rest` if you wish
      to retrieve a catalog from the puppet master.

      FORMATTING ISSUES: This action cannot currently render useful yaml;
      instead, it returns an entire catalog. Use json instead.
    NOTES
    examples <<-'EOT'
      Ask the puppet master for a list of managed file resources for a node:

      $ puppet catalog select --terminus rest somenode.magpie.lan file
    EOT
    when_invoked do |host, type, options|
      # REVISIT: Eventually, type should have a default value that triggers
      # the non-specific behaviour.  For now, though, this will do.
      # --daniel 2011-05-03
      catalog = Puppet::Resource::Catalog.indirection.find(host)

      if type == '*'
        catalog.resources
      else
        type = type.downcase
        catalog.resources.reject { |res| res.type.downcase != type }
      end
    end

    when_rendering :console do |value|
      if value.nil? then
        _("no matching resources found")
      else
        value.map {|x| x.to_s }.join("\n")
      end
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit