Class: Puppet::Util::NetworkDevice
- Defined in:
- lib/puppet/util/network_device.rb
Defined Under Namespace
Modules: Transport Classes: Base, Config
Class Attribute Summary collapse
-
.current ⇒ Object
readonly
Returns the value of attribute current.
Class Method Summary collapse
- .init(device) ⇒ Object
-
.teardown ⇒ Object
Should only be used in tests.
Class Attribute Details
.current ⇒ Object (readonly)
Returns the value of attribute current.
5 6 7 |
# File 'lib/puppet/util/network_device.rb', line 5 def current @current end |
Class Method Details
.init(device) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/puppet/util/network_device.rb', line 8 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, device.) rescue => detail raise detail, _("Can't load %{provider} for %{device}: %{detail}") % { provider: device.provider, device: device.name, detail: detail }, detail.backtrace end |
.teardown ⇒ Object
Should only be used in tests
16 17 18 |
# File 'lib/puppet/util/network_device.rb', line 16 def self.teardown @current = nil end |