Sha256: 2dae54b6d0a50777836a3fe6a01362f4fcc4eb8c5a38f20d541a006e9076fa66

Contents?: true

Size: 638 Bytes

Versions: 175

Compression:

Stored size: 638 Bytes

Contents

class Specinfra::Helper::DetectOs::Coreos < Specinfra::Helper::DetectOs
  def detect
    if run_command('ls /etc/coreos/update.conf').success?
      distro  = nil
      release = nil
      lsb_release = run_command("cat /etc/lsb-release")
      if lsb_release.success?
        lsb_release.stdout.each_line do |line|
          distro  = line.split('=').last.strip if line =~ /^DISTRIB_ID=/
          release = line.split('=').last.strip if line =~ /^DISTRIB_RELEASE=/
        end
      end
      distro ||= 'coreos'
      release ||= nil
      { :family => distro.gsub(/[^[:alnum:]]/, '').downcase, :release => release }
    end
  end
end

Version data entries

175 entries across 175 versions & 3 rubygems

Version Path
specinfra-rb19-2.44.7 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.9 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.8 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.7 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.6 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.5 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.3 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.2 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.1 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.67.0 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.9 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.8 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.7 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.6 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.5 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.4 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.3 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.2 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.1 lib/specinfra/helper/detect_os/coreos.rb
specinfra-2.66.0 lib/specinfra/helper/detect_os/coreos.rb