Sha256: 726631d33456944d33c8e32f454f7e89be7448e22a22fac6a09dcfbf92b41a76

Contents?: true

Size: 873 Bytes

Versions: 20

Compression:

Stored size: 873 Bytes

Contents

# frozen_string_literal: true
require_relative '../../../puppet/util/autoload'
require 'uri'
require_relative '../../../puppet/util/network_device/transport'
require_relative '../../../puppet/util/network_device/transport/base'

class Puppet::Util::NetworkDevice::Base

  attr_accessor :url, :transport

  def initialize(url, options = {})
    @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(options[: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
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/util/network_device/base.rb
puppet-8.3.0-x86-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.3.0-x64-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.3.0-universal-darwin lib/puppet/util/network_device/base.rb
puppet-8.3.1 lib/puppet/util/network_device/base.rb
puppet-8.3.1-x86-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.3.1-x64-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.3.1-universal-darwin lib/puppet/util/network_device/base.rb
puppet-8.2.0 lib/puppet/util/network_device/base.rb
puppet-8.2.0-x86-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.2.0-x64-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.2.0-universal-darwin lib/puppet/util/network_device/base.rb
puppet-8.1.0 lib/puppet/util/network_device/base.rb
puppet-8.1.0-x86-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.1.0-x64-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.1.0-universal-darwin lib/puppet/util/network_device/base.rb
puppet-8.0.1 lib/puppet/util/network_device/base.rb
puppet-8.0.1-x86-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.0.1-x64-mingw32 lib/puppet/util/network_device/base.rb
puppet-8.0.1-universal-darwin lib/puppet/util/network_device/base.rb