summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Salo <jari.salo@tdc.fi>2014-08-06 14:12:19 +0300
committerJari Salo <jari.salo@tdc.fi>2014-08-06 14:12:19 +0300
commitbf299889f54b468412df4822b515cf7c4d60f90d (patch)
treea1797f24c4afc4ab3cd60bf06393c75e12dbb409
parentc7bbdd072c74902edda09a442688291b0d7f1c09 (diff)
Added Huawei VRP model support.
-rw-r--r--CHANGELOG.md1
-rw-r--r--README.md1
-rw-r--r--lib/oxidized/model/vrp.rb34
3 files changed, 36 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b5f59f6..2567f51 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
# 0.2.3
- BUGFIX: rescue @ssh.close when far end closes disgracefully (ALU ISAM)
- FEATURE: Alcatel-Lucent ISAM 7302/7330 model added by @jalmargyyk
+- FEATURE: Huawei VRP model added by @jalmargyyk
# 0.2.2
- BUGFIX: mark node as failure if unknown error is raised
diff --git a/README.md b/README.md
index 2bb2b34..704b158 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,7 @@
* Force10 FTOS
* FortiGate FortiOS
* HP ProCurve
+ * Huawei VRP
* Juniper JunOS
* Juniper ScreenOS (Netscreen)
diff --git a/lib/oxidized/model/vrp.rb b/lib/oxidized/model/vrp.rb
new file mode 100644
index 0000000..12a9ca3
--- /dev/null
+++ b/lib/oxidized/model/vrp.rb
@@ -0,0 +1,34 @@
+class VRP < Oxidized::Model
+ # Huawei VRP
+
+ prompt /^(<[\w.-]+>)$/
+ comment '# '
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+ cfg :telnet do
+ username /^Username:$/
+ password /^Password:$/
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'screen-length 0 temporary'
+ pre_logout 'quit'
+ end
+
+ cmd 'display version' do |cfg|
+ cfg = cfg.each_line.select {|l| not l.match /uptime/ }.join
+ comment cfg
+ end
+
+ cmd 'display device' do |cfg|
+ comment cfg
+ end
+
+ cmd 'display current-configuration all' do |cfg|
+ cfg
+ end
+
+end