diff options
author | Saku Ytti <saku@ytti.fi> | 2015-09-14 11:31:20 +0300 |
---|---|---|
committer | Saku Ytti <saku@ytti.fi> | 2015-09-14 11:31:20 +0300 |
commit | 969f7d05d9e7cac44ce67d5c12dbbbe7c547bcc4 (patch) | |
tree | 46a6f446cfc4b2555235c943b2a4b1d81cef51a0 | |
parent | 3c1c5106ccc3e45d9ab791458a53a252497d0203 (diff) | |
parent | 0b6530bdcb228ce295a1dca9c427a44fa7497698 (diff) |
Merge branch 'master' of github.com:ytti/oxidized0.8.0
-rw-r--r-- | lib/oxidized/model/ironware.rb | 5 | ||||
-rw-r--r-- | lib/oxidized/output/git.rb | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index ad795d5..805e07b 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -1,6 +1,6 @@ class IronWare < Oxidized::Model - prompt /^.+[>#]\s?$/ + prompt /^.*(telnet|ssh)\@.+[>#]\s?$/i comment '! ' #to handle pager without enable @@ -32,7 +32,7 @@ class IronWare < Oxidized::Model end cmd 'show chassis' do |cfg| - cfg.gsub! /\xFF/n, '' # ugly hack - avoids JSON.dump utf-8 breakage on 1.9.. + cfg.encode!("UTF-8", :invalid => :replace) #sometimes ironware returns broken encoding cfg.gsub! /(^((.*)Current temp(.*))$)/, '' #remove unwanted lines current temperature cfg.gsub! /Speed = [A-Z]{3} \(\d{2}\%\)/, '' #remove unwanted lines Speed Fans cfg.gsub! /current speed is [A-Z]{3} \(\d{2}\%\)/, '' @@ -71,6 +71,7 @@ class IronWare < Oxidized::Model send vars(:enable) + "\n" end end + post_login '' post_login 'skip-page-display' post_login 'terminal length 0' pre_logout 'logout' diff --git a/lib/oxidized/output/git.rb b/lib/oxidized/output/git.rb index e568a58..3757cfc 100644 --- a/lib/oxidized/output/git.rb +++ b/lib/oxidized/output/git.rb @@ -19,6 +19,7 @@ class Git < Output CFGS.save :user raise NoConfig, 'no output git config, edit ~/.config/oxidized/config' end + @cfg.repo = File.expand_path @cfg.repo end def store file, outputs, opt={} @@ -26,7 +27,7 @@ class Git < Output @user = (opt[:user] or @cfg.user) @email = (opt[:email] or @cfg.email) @opt = opt - repo = File.expand_path @cfg.repo + repo = @cfg.repo outputs.types.each do |type| type_cfg = '' |