From fd72acca25590f95e21b1e906683d9050a6d086e Mon Sep 17 00:00:00 2001 From: roedie Date: Thu, 18 Feb 2016 16:02:59 +0100 Subject: Fix fortios more prompt To make this work, the timeout must be high as wel. About 120 sec in my tests --- lib/oxidized/model/fortios.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb index 3515b46..92add0e 100644 --- a/lib/oxidized/model/fortios.rb +++ b/lib/oxidized/model/fortios.rb @@ -4,6 +4,11 @@ class FortiOS < Oxidized::Model prompt /^([-\w\.]+(\s[\(\w\-\.\)]+)?\~?\s?[#>]\s?)$/ + expect /^--More--\s$/ do |data, re| + send ' ' + data.sub re, '' + end + cmd :all do |cfg, cmdstring| new_cfg = comment "COMMAND: #{cmdstring}\n" new_cfg << cfg.each_line.to_a[1..-2].map { |line| line.gsub(/(conf_file_ver=)(.*)/, '\1\3') }.join -- cgit v1.2.1