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
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 7
def initialize(options)
super(options)
logger.level = Logger::INFO
@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? }
@prompt = /^\S+[>#]\r\n.*$/
end
|
Instance Method Details
#unique_identifier ⇒ Object
28
29
30
31
32
33
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 28
def unique_identifier
result = run_command_via_connection('show inventory').stdout
result.split("\r\n\r\n").each do |section|
return section.split('SN: ')[1].strip if section.include?('Chassis')
end
end
|
#uri ⇒ Object
24
25
26
|
# File 'lib/train/transports/cisco_ios_connection.rb', line 24
def uri
"ssh://#{@user}@#{@host}:#{@port}"
end
|