Class: Puppet::Util::NetworkDevice::Base
- Defined in:
- lib/puppet/util/network_device/base.rb
Instance Attribute Summary collapse
-
#transport ⇒ Object
Returns the value of attribute transport.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(url, options = {}) ⇒ Base
Returns a new instance of Base.
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/puppet/util/network_device/base.rb', line 11 def initialize(url, = {}) @url = URI.parse(url) @autoloader = Puppet::Util::Autoload.new(self, "puppet/util/network_device/transport") if @autoloader.load(@url.scheme, Puppet.lookup(:current_environment)) @transport = Puppet::Util::NetworkDevice::Transport.const_get(@url.scheme.capitalize).new([:debug]) @transport.host = @url.host @transport.port = @url.port || case @url.scheme; when "ssh"; 22; when "telnet"; 23; end @transport.user = @url.user @transport.password = @url.password end end |
Instance Attribute Details
#transport ⇒ Object
Returns the value of attribute transport.
9 10 11 |
# File 'lib/puppet/util/network_device/base.rb', line 9 def transport @transport end |
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/puppet/util/network_device/base.rb', line 9 def url @url end |