Class: Puppet::Util::NetworkDevice::Base
- Defined in:
- lib/puppet/util/network_device/base.rb
Direct Known Subclasses
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.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/puppet/util/network_device/base.rb', line 10 def initialize(url, = {}) @url = URI.parse(url) @autoloader = Puppet::Util::Autoload.new(self, "puppet/util/network_device/transport") if @autoloader.load(@url.scheme) @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.
8 9 10 |
# File 'lib/puppet/util/network_device/base.rb', line 8 def transport @transport end |
#url ⇒ Object
Returns the value of attribute url.
8 9 10 |
# File 'lib/puppet/util/network_device/base.rb', line 8 def url @url end |