Class: Puppet::Util::NetworkDevice::Transport::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/util/network_device/transport/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



10
11
12
# File 'lib/puppet/util/network_device/transport/base.rb', line 10

def initialize
  @timeout = 10
end

Instance Attribute Details

#default_promptObject

Returns the value of attribute default_prompt.



8
9
10
# File 'lib/puppet/util/network_device/transport/base.rb', line 8

def default_prompt
  @default_prompt
end

#hostObject

Returns the value of attribute host.



7
8
9
# File 'lib/puppet/util/network_device/transport/base.rb', line 7

def host
  @host
end

#passwordObject

Returns the value of attribute password.



7
8
9
# File 'lib/puppet/util/network_device/transport/base.rb', line 7

def password
  @password
end

#portObject

Returns the value of attribute port.



7
8
9
# File 'lib/puppet/util/network_device/transport/base.rb', line 7

def port
  @port
end

#timeoutObject

Returns the value of attribute timeout.



8
9
10
# File 'lib/puppet/util/network_device/transport/base.rb', line 8

def timeout
  @timeout
end

#userObject

Returns the value of attribute user.



7
8
9
# File 'lib/puppet/util/network_device/transport/base.rb', line 7

def user
  @user
end

Instance Method Details

#command(cmd, options = {}) ⇒ Object



20
21
22
23
24
25
# File 'lib/puppet/util/network_device/transport/base.rb', line 20

def command(cmd, options = {})
  send(cmd)
  expect(options[:prompt] || default_prompt) do |output|
    yield output if block_given?
  end
end

#expect(prompt) ⇒ Object



17
18
# File 'lib/puppet/util/network_device/transport/base.rb', line 17

def expect(prompt)
end

#send(cmd) ⇒ Object



14
15
# File 'lib/puppet/util/network_device/transport/base.rb', line 14

def send(cmd)
end