diff options
author | Wild Kat <wk@futureinquestion.net> | 2018-05-09 13:04:16 +0200 |
---|---|---|
committer | Wild Kat <wk@futureinquestion.net> | 2018-05-09 13:22:04 +0200 |
commit | 9273e5feee159040622348d922512dd6b2f097b9 (patch) | |
tree | 3ad2d92333a8aeabc6362b50a6195a2551d71dc6 | |
parent | be2a66feda3350673dd2d963a203e1cc5d68a017 (diff) |
tidy up and add references for stoneos model
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | docs/Supported-OS-Types.md | 2 | ||||
-rw-r--r-- | lib/oxidized/model/stoneos.rb | 22 |
3 files changed, 11 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e7f09e..90456d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Master +* FEATURE: stoneos model (@macaty) * FEATURE: openwrt model (@z00nx) ## 0.21.0 diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index 75845b9..ce0f9c6 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -95,6 +95,8 @@ * [Broadband Network Platform Software](/lib/oxidized/model/gcombnps.rb) * Hatteras * [Hatteras](/lib/oxidized/model/hatteras.rb) +* Hillstone Networks + * [StoneOS](/lib/oxidized/model/stoneos.rb) * Hirschmann * [HiOS](/lib/oxidized/model/hirschmann.rb) * HP diff --git a/lib/oxidized/model/stoneos.rb b/lib/oxidized/model/stoneos.rb index 405e389..d2bc017 100644 --- a/lib/oxidized/model/stoneos.rb +++ b/lib/oxidized/model/stoneos.rb @@ -1,25 +1,19 @@ -class Stoneos < Oxidized::Model -#Hillstone Networks StoneOS software +class StoneOS < Oxidized::Model + # Hillstone Networks StoneOS software prompt /^\r?[\w.()-]+[#>](\s)?$/ comment '# ' - + expect /^\s.*--More--.*$/ do |data, re| - send ' ' - data.sub re, '' - end - - cmd :all do |cfg| - cfg = cfg.lines.to_a[1..-2].join + send ' ' + data.sub re, '' end - cmd :secret do |cfg| - cfg + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join end - cmd 'show configuration running' do |cfg| - cfg - end + cmd 'show configuration running' cmd 'show version' do |cfg| comment cfg |