aubergine 0.1.0 → 0.1.1

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: cce6f4ea056da4292c48d05c33c1ce72b73f2506
4
- data.tar.gz: 2099ea7142821ee1b3fb4706d2ca3e3c8f471bac
3
+ metadata.gz: 2777d9fa63ef0fb21679ded2cd4fa0ac29df1b04
4
+ data.tar.gz: f2a55afbf0cd9825f5463b071462dcf6ee0bfd9e
5
5
  SHA512:
6
- metadata.gz: d66a4ba1454464abdaab3cdda4d68bbbaa1817db30f561cb466999df4cc27a3e86e510a18df96065f096ca853d7255176c47ce6f6aa03aa57eacd169ff0735ce
7
- data.tar.gz: 7a707223d1451d9eec8c2da53a06a4edd7caa9d4b4d7f59e4bb4d8b84ca1c9d99767500b57122866a715e06bb3fb29e9b896020727cec6f733564a675b5b7700
6
+ metadata.gz: 37980fe0172007d19ad5f4d105097b74c8cea0de65cee57afbac53e22fbb966306093317a85ac6aa6aaebbd9698f6f914c7b18fab8f7c9bd4806e2c8320b302f
7
+ data.tar.gz: 91d2bcc4929030e5732166a25a68a78373b06f1e5f7e7332700b101a1cf7b67bb7d73b7eea4f222f51b15c71cd7be0e8d1c54a99a5b1bd4b6f077f3df324d970
@@ -4,7 +4,8 @@ module Courgette
4
4
  'hp' => Commutateurs::HP,
5
5
  'cisco' => Commutateurs::Cisco,
6
6
  'juniper' => Commutateurs::Juniper,
7
- 'fortigate' => Commutateurs::Fortigate
7
+ 'fortigate' => Commutateurs::Fortigate,
8
+ 'h3c' => Commutateurs::H3c
8
9
  }
9
10
 
10
11
  attr_reader :ip, :vendor
@@ -10,7 +10,11 @@ module Courgette
10
10
 
11
11
  def launch!(filter)
12
12
  Parallel.each(client.devices.select { |device| filter.call(device) }, in_threads: @executors) do |device|
13
- fetch_and_update(device)
13
+ begin
14
+ Timeout::timeout(240) { fetch_and_update(device) }
15
+ rescue
16
+ logger.info "#{device.ip} execution too long (timeout)"
17
+ end
14
18
  end
15
19
  end
16
20
 
data/lib/courgette.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'logger'
2
+ require 'timeout'
2
3
 
3
4
  require 'httparty'
4
5
  require 'json'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aubergine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Rose
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.1
19
+ version: 0.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.1
26
+ version: 0.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: git
29
29
  requirement: !ruby/object:Gem::Requirement