Sha256: 20b16b32c3351da377f04bd2076882d7b82a32cd3e199a7736110609b787048c

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

class Specinfra::Helper::DetectOs::Ios_xr < Specinfra::Helper::DetectOs
  def detect
    # CentOS has a os-release file too, but this should do the right thing
    if File.exists?('/etc/cisco-release')
      contents = {}
      File.read('/etc/cisco-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['ID'] == "ios_xr" && contents['ID_LIKE'] && contents['ID_LIKE'].include?('wrlinux')
        { :family => 'ios_xr', :release => contents['VERSION'] }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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