Sha256: 3191a99fbffc29100ac2c1f22cf7b72acb348660d54b32ea06c1a05329431936

Contents?: true

Size: 802 Bytes

Versions: 39

Compression:

Stored size: 802 Bytes

Contents

class Specinfra::Helper::DetectOs::Redhat < Specinfra::Helper::DetectOs
  def 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

39 entries across 39 versions & 1 rubygems

Version Path
specinfra-2.35.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.35.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.9 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.8 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.7 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.6 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.5 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.4 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.3 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.2 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.34.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.33.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.33.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.32.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.31.1 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.31.0 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.30.4 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.30.3 lib/specinfra/helper/detect_os/redhat.rb
specinfra-2.30.2 lib/specinfra/helper/detect_os/redhat.rb