MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.217.207.112
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/ruby/vendor_ruby/puppet/util/instrumentation/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/ruby/vendor_ruby/puppet/util/instrumentation/indirection_probe.rb
require 'puppet/indirector'
require 'puppet/util/instrumentation'

# We need to use a class other than Probe for the indirector because
# the Indirection class might declare some probes, and this would be a huge unbreakable
# dependency cycle.
class Puppet::Util::Instrumentation::IndirectionProbe
  extend Puppet::Indirector

  indirects :instrumentation_probe, :terminus_class => :local

  attr_reader :probe_name

  def initialize(probe_name)
    @probe_name = probe_name
  end

  def to_data_hash
    { :name => probe_name }
  end

  def to_pson_data_hash
    {
      :document_type => "Puppet::Util::Instrumentation::IndirectionProbe",
      :data => to_data_hash,
    }
  end

  def to_pson(*args)
    to_pson_data_hash.to_pson(*args)
  end

  def self.from_data_hash(data)
    self.new(data["name"])
  end

  def self.from_pson(data)
    Puppet.deprecation_warning("from_pson is being removed in favour of from_data_hash.")
    self.from_data_hash(data)
  end
end

MMCT - 2023