Class: PuppetX::CiscoIOS::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/puppetlabs/cisco_ios/check.rb

Overview

Helper function to check if we should load the resource_api

Class Method Summary collapse

Class Method Details

.use_old_netdev_typeObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/puppet_x/puppetlabs/cisco_ios/check.rb', line 5

def self.use_old_netdev_type
  # check if Resource API is available
  begin
    require 'puppet/resource_api'
  rescue LoadError
    return true
  end
  # is this an agent running on a network device do no use RSAPI - there are only a few of them
  use_old_netdev = ['aristaeos', 'ios_xr', 'nexus'].include? Facter.value('operatingsystem').downcase
  use_old_netdev
end