Class: ASA
Instance Attribute Summary
#input, #node
Instance Method Summary
collapse
cfg, #cfg, cfgs, cmd, #cmd, cmds, comment, #comment, expect, #expect, expects, #expects, #get, inherited, #output, post, pre, prompt, #prompt, #screenscrape, #send, #xmlcomment
#vars
Instance Method Details
#multiple_context ⇒ Object
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# File 'lib/oxidized/model/asa.rb', line 91
def multiple_context
cmd 'changeto system' do |cfg|
cmd 'show running-config' do |systemcfg|
allcfg = "\n\n" + systemcfg + "\n\n"
contexts = systemcfg.scan(/^context (\S+)$/)
files = systemcfg.scan(/config-url (\S+)$/)
contexts.each_with_index do |cont, i|
allcfg = allcfg + "\n\n----------========== [ CONTEXT " + cont.join(" ") + " FILE " + files[i].join(" ") + " ] ==========----------\n\n"
cmd "more " + files[i].join(" ") do |cfgcontext|
allcfg = allcfg + "\n\n" + cfgcontext
end
end
cfg = allcfg
end
cfg
end
end
|
#single_context ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# File 'lib/oxidized/model/asa.rb', line 67
def single_context
cmd 'more system:running-config' do |cfg|
cfg = cfg.each_line.to_a[3..-1].join
cfg.gsub! /^: [^\n]*\n/, ''
anyconnect_profiles = cfg.scan(Regexp.new('(\sdisk0:/.+\.xml)')).flatten
anyconnect_profiles.each do |profile|
cfg << ( profile + "\n")
cmd("more" + profile) do |xml|
cfg << ( xml)
end
end
if cfg.rindex(/dynamic-access-policy-record\s(?!DfltAccessPolicy)/)
cfg << ( "disk0:/dap.xml\n")
cmd "more disk0:/dap.xml" do |xml|
cfg << ( xml)
end
end
cfg
end
end
|