Class: Train::Transports::SSH::CiscoIOSConnection
- Inherits:
-
BaseConnection
- Object
- BaseConnection
- Train::Transports::SSH::CiscoIOSConnection
show all
- Defined in:
- lib/train/transports/cisco_ios_connection.rb
Defined Under Namespace
Classes: BadEnablePassword
Instance Method Summary
collapse
Constructor Details
Returns a new instance of CiscoIOSConnection.
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 5
def initialize(options)
super(options)
@host = options.delete(:host)
@user = options.delete(:user)
@port = options.delete(:port)
@enable_password = options.delete(:enable_password)
@ssh_options = options.reject { |_key, value| value.nil? }
@ssh_options[:append_all_supported_algorithms] = true
@prompt = /^\S+[>#]\r\n.*$/
end
|
Instance Method Details
#download(remotes, local) ⇒ Object
36
37
38
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 36
def download(remotes, local)
raise NotImplementedError, "#{self.class} does not implement #download()"
end
|
#unique_identifier ⇒ Object
27
28
29
30
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 27
def unique_identifier
result = run_command_via_connection("show version | include Processor")
result.stdout.split(" ")[-1]
end
|
#upload(locals, remote) ⇒ Object
32
33
34
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 32
def upload(locals, remote)
raise NotImplementedError, "#{self.class} does not implement #upload()"
end
|
#uri ⇒ Object
23
24
25
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 23
def uri
"ssh://#{@user}@#{@host}:#{@port}"
end
|