summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/fortios.rb23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index 5e865be..4a46877 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -10,22 +10,27 @@ class FortiOS < Oxidized::Model
end
cmd 'get system status' do |cfg|
+ @vdom_enabled = cfg.include? 'Virtual domain configuration: enable'
comment cfg
end
- cmd 'config global'
+ post do
+ cfg = []
+ cfg << cmd('config global') if @vdom_enabled
- cmd 'get hardware status' do |cfg|
- comment cfg
- end
+ cfg << cmd('get hardware status') do |cfg|
+ comment cfg
+ end
- cmd 'diagnose autoupdate version' do |cfg|
- comment cfg
- end
+ cfg << cmd('diagnose autoupdate version') do |cfg|
+ comment cfg
+ end
- cmd 'end'
+ cfg << cmd('end') if @vdom_enabled
- cmd 'show'
+ cfg << cmd('show')
+ cfg.join "\n"
+ end
cfg :telnet do
username /^Username:/