aubergine 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2777d9fa63ef0fb21679ded2cd4fa0ac29df1b04
4
- data.tar.gz: f2a55afbf0cd9825f5463b071462dcf6ee0bfd9e
3
+ metadata.gz: e409d0bb1f0ea8ed178eaeb66a1c9909233e3e79
4
+ data.tar.gz: 4d205939739ae62b7d90eebe4352595d242673cb
5
5
  SHA512:
6
- metadata.gz: 37980fe0172007d19ad5f4d105097b74c8cea0de65cee57afbac53e22fbb966306093317a85ac6aa6aaebbd9698f6f914c7b18fab8f7c9bd4806e2c8320b302f
7
- data.tar.gz: 91d2bcc4929030e5732166a25a68a78373b06f1e5f7e7332700b101a1cf7b67bb7d73b7eea4f222f51b15c71cd7be0e8d1c54a99a5b1bd4b6f077f3df324d970
6
+ metadata.gz: 7e60aae7bc388dece40916c46d3e73503385dc9be44973687d0cc3e9d7fcb3421fb188b9df513d6513e3871a1b68d82942988eae47d14198ef838c7836956ed7
7
+ data.tar.gz: 0ce67edc5ebb5c842460bce502764559eb83a5f59155d5276c7511ac3f9413dfa94782e240bdf9f1e646bc1a2a00469b74cac4439fcf202aa07bd7ee52ffee05
@@ -1,7 +1,7 @@
1
1
  module Courgette
2
2
  class Device
3
3
  VENDOR_CLASSES = {
4
- 'hp' => Commutateurs::HP,
4
+ 'hp' => Courgette::HP, # using sftp
5
5
  'cisco' => Commutateurs::Cisco,
6
6
  'juniper' => Commutateurs::Juniper,
7
7
  'fortigate' => Commutateurs::Fortigate,
@@ -31,7 +31,9 @@ module Courgette
31
31
  rescue Errno::ECONNREFUSED
32
32
  logger.info "#{device.ip} is unreachable (connection refused)"
33
33
  rescue Net::SSH::Exception => e
34
- logger.info "#{device.ip} ssh error (#{e.message})"
34
+ logger.info "#{device.ip} ssh error (#{e.message})"
35
+ rescue => e
36
+ logger.info "#{device.ip} fatal error (#{e.message})"
35
37
  end
36
38
  end
37
39
  end
@@ -0,0 +1,32 @@
1
+ module Courgette
2
+ class HP
3
+ def initialize(ip, credentials, verbose = false)
4
+ @ip = ip
5
+ @credentials = credentials
6
+ end
7
+
8
+ def enable
9
+ end
10
+
11
+ def connect
12
+ end
13
+
14
+ def configuration
15
+ begin
16
+ data = ""
17
+ Net::SFTP.start(@ip, @credentials.user, :password => @credentials.password) do |sftp|
18
+ data = sftp.download!("/cfg/running-config")
19
+ end
20
+ data
21
+ rescue IOError => e
22
+ data
23
+ end
24
+ end
25
+
26
+ def save
27
+ end
28
+
29
+ def disconnect
30
+ end
31
+ end
32
+ end
data/lib/courgette.rb CHANGED
@@ -7,6 +7,7 @@ require 'json'
7
7
  require 'commutateurs'
8
8
  require 'parallel'
9
9
 
10
+ require_relative './courgette/hp.rb'
10
11
  require_relative './courgette/device.rb'
11
12
  require_relative './courgette/client.rb'
12
13
  require_relative './courgette/executor.rb'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aubergine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Rose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-16 00:00:00.000000000 Z
11
+ date: 2013-07-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commutateurs
@@ -89,6 +89,7 @@ files:
89
89
  - lib/aubergine/path.rb
90
90
  - lib/aubergine/satellite.rb
91
91
  - lib/aubergine/server.rb
92
+ - lib/courgette/hp.rb
92
93
  - lib/courgette/client.rb
93
94
  - lib/courgette/device.rb
94
95
  - lib/courgette/executor.rb