diff options
author | Elvin Efendi <elvin.efendiyev@gmail.com> | 2015-11-13 11:19:20 -0500 |
---|---|---|
committer | Elvin Efendi <elvin.efendiyev@gmail.com> | 2015-11-13 11:19:20 -0500 |
commit | 5a2364e50620b825d5325bfbbc5d0f3d8578e25f (patch) | |
tree | 0e985374cc7b4bd8111c012072c39218335881ef /lib/oxidized/model/junos.rb | |
parent | 1400b842f6dc61e662ce15f72f578a55126ffc06 (diff) | |
parent | f2da63369fcb754e3715091cc4fd2f93db42106e (diff) |
Merge pull request #2 from Shopify/testing-refactoring
Testing refactoring
Diffstat (limited to 'lib/oxidized/model/junos.rb')
-rw-r--r-- | lib/oxidized/model/junos.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 0e921d2..da3af72 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -3,7 +3,7 @@ class JunOS < Oxidized::Model comment '# ' def telnet - @input.class.to_s.match /Telnet/ + @input.class.to_s.match(/Telnet/) end cmd :all do |cfg| @@ -12,16 +12,16 @@ class JunOS < Oxidized::Model cfg.lines.map { |line| line.rstrip }.join("\n") + "\n" end - cmd :secret do |cfg| - cfg.gsub! /encrypted-password (\S+).*/, '<secret removed>' - cfg.gsub! /community (\S+) {/, 'community <hidden> {' + cmd :secret do |cfg| + cfg.gsub!(/encrypted-password (\S+).*/, '<secret removed>') + cfg.gsub!(/community (\S+) {/, 'community <hidden> {') cfg end cmd 'show configuration | display omit' cmd 'show version' do |cfg| - @model = $1 if cfg.match /^Model: (\S+)/ + @model = $1 if cfg.match(/^Model: (\S+)/) comment cfg end @@ -39,8 +39,8 @@ class JunOS < Oxidized::Model end cfg :telnet do - username /^login:/ - password /^Password:/ + username(/^login:/) + password(/^Password:/) end cfg :ssh do |