blob: 7fb8e2ff3641982d34ec22c7c3121d7f5aade339 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
class Puppet::Util::NetworkDevice
class << self
attr_reader :current
end
def self.init(device)
require "puppet/util/network_device/#{device.provider}/device"
@current = Puppet::Util::NetworkDevice.const_get(device.provider.capitalize).const_get(:Device).new(device.url)
rescue => detail
raise "Can't load #{device.provider} for #{device.name}: #{detail}"
end
# Should only be used in tests
def self.teardown
@current = nil
end
end
|