From 7736730a1366b61553f8f7245941f5c3b96bc5ae Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Sun, 13 Sep 2015 14:16:39 +0100 Subject: workaround for broken ironware cli, which occasionally swallows input without trace --- lib/oxidized/model/ironware.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index ad795d5..4764d94 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -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' -- cgit v1.2.1 From 32ef433ff00d1f9fede7ffa699f33c2515ac1a02 Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Sun, 13 Sep 2015 21:13:00 +0100 Subject: ironware prompt matches normal config --- lib/oxidized/model/ironware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 4764d94..709e912 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 -- cgit v1.2.1 From 3ff08b9ffa39f1f77c50d39549187191bb6f0be7 Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Sun, 13 Sep 2015 23:27:21 +0100 Subject: smooth over ironware broken encoding --- lib/oxidized/model/ironware.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 709e912..805e07b 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -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}\%\)/, '' -- cgit v1.2.1 From d29d2774dac1e5e5eadceccb9edf8c4a2103c3ef Mon Sep 17 00:00:00 2001 From: Nick Hilliard Date: Mon, 14 Sep 2015 00:12:31 +0100 Subject: cfg.repo needs to be fixed up with File.expand_path on init --- lib/oxidized/output/git.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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 = '' -- cgit v1.2.1