Sha256: b2e5998b95ef0f56a81b5997f957e61c4bee3f461a4ce81f48f908d6c8dad376

Contents?: true

Size: 663 Bytes

Versions: 2

Compression:

Stored size: 663 Bytes

Contents

class Specinfra::Helper::DetectOs::Nexus < Specinfra::Helper::DetectOs
  def detect
    # CentOS has a os-release file too, but this should do the right thing
    if File.exists?('/etc/os-release')
      contents = {}
      File.read('/etc/os-release').split.collect {|x| x.split('=')}.each {|x| contents[x[0]] = x[1]}
      # This test should only work on a nexus platform in the native OS
      # It will fail in a guest/container shell, which should be picked up elsewhere
      if contents['CISCO_RELEASE_INFO'] && contents['CISCO_RELEASE_INFO'] == "/etc/os-release"
        { :family => 'nexus', :release => contents['VERSION'] }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
specinfra-cisco-2.41.0 lib/specinfra/helper/detect_os/nexus.rb
specinfra-cisco-2.40.2 lib/specinfra/helper/detect_os/nexus.rb