ytti / oxidized

Oxidized is a network device configuration backup tool. It's a RANCID replacement!
Apache License 2.0
2.69k stars 909 forks source link

Huawei Model extend to save config #3203

Open jimbos opened 2 weeks ago

jimbos commented 2 weeks ago

As the title , we want to save config after display config , but Huawei save config has interact , just like that : "Are you sure to continue?[Y/N]:" So how should I to write the Model code to answer that ?

marmack95 commented 2 weeks ago

Take a look at the extended model i put here.

jimbos commented 2 weeks ago

require 'oxidized/model/vrp.rb'

class VRP using Refinements

expect /^([\w\W]+)$/ do send "Y\n" end

cmd 'save' do |cfg|

comment cfg

end

end

Thx

jimbos commented 2 weeks ago

BTW,the name is "vrp-extra.rb" , locate at ./config/oxidized/model/ .