Sha256: f77297234880f418e0ce712a838359b5069fb5c64640ee3121e2aabecaf3812d

Contents?: true

Size: 807 Bytes

Versions: 127

Compression:

Stored size: 807 Bytes

Contents

class Specinfra::Helper::DetectOs::Redhat < Specinfra::Helper::DetectOs
  def self.detect
    # Fedora also has an /etc/redhat-release so the Fedora check must
    # come before the RedHat check
    if run_command('ls /etc/fedora-release').success?
      line = run_command('cat /etc/redhat-release').stdout
      if line =~ /release (\d[\d]*)/
        release = $1
      end
      { :family => 'fedora', :release => release }
    elsif run_command('ls /etc/redhat-release').success?
      line = run_command('cat /etc/redhat-release').stdout
      if line =~ /release (\d[\d.]*)/
        release = $1
      end

      { :family => 'redhat', :release => release }
    elsif run_command('ls /etc/system-release').success?
      { :family => 'redhat', :release => nil  } # Amazon Linux
    end
  end
end





Version data entries

127 entries across 127 versions & 1 rubygems

Version Path
specinfra-2.21.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.21.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.20.2 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.20.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.20.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.6 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.5 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.4 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.3 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.2 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.19.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.18.3 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.18.2 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.18.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.18.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.17.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.17.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.16.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.15.2 lib/specinfra/helper/detect_os/redhat.rb