genesis_collector 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 208f4ec96b38ba5d57e06c70ec9cf0771b566da9
4
- data.tar.gz: 08e9f2d38f9a0df9bbf83080dfb086b499c3cb5d
3
+ metadata.gz: cf580c6e7c7d908644417461cdd1289c33fafd74
4
+ data.tar.gz: e002b3168daf4bb67b3307255d855b80f5a50192
5
5
  SHA512:
6
- metadata.gz: 786aa2d00b95c9bd341adc132166346c1e764a25ea8051d0d9373b6b52e1a2898dbe83cef3fad4d8765045e48546a3e4d39ec9c66208f583fe7e0092cbb4fc49
7
- data.tar.gz: 12c5f4036cf0908efaded80a491143ef29f9e15ed98d9d27b2520bb70ab02d0862300075220335f0640030d737b78c20e95ed62c282aef46d85521875bda0bd6
6
+ metadata.gz: 24efe9a3a8d1c0df521fc1ea64c2ed9141b5a688b8ba81472d3af79a02ce0a9548fec34fc7a9b1a35b8d7569eeccf2c6bc5f162661be7eeb3fee5ea5316e0bca
7
+ data.tar.gz: 15261eab99feae8d834ba6300ea96d88b1516b9a0cc157810c5a18f503fae7f2dfea026a19be05cf40669a2d1a45a41865f6d8ab4c2187bb9dde67714aa11d2d
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 David Radcliffe
3
+ Copyright (c) 2016 Shopify
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -2,6 +2,11 @@ require 'chef/handler'
2
2
  require 'chef/mash'
3
3
  require 'genesis_collector'
4
4
 
5
+ begin
6
+ require 'bugsnag'
7
+ rescue LoadError
8
+ end
9
+
5
10
  class Chef
6
11
  class Handler
7
12
  class Genesis < Chef::Handler
@@ -9,6 +14,11 @@ class Chef
9
14
 
10
15
  def initialize(config = {})
11
16
  @config = Mash.new(config)
17
+ if defined?(Bugsnag)
18
+ Bugsnag.configure do |config|
19
+ config.api_key = @config.delete('bugsnag_api_key')
20
+ end
21
+ end
12
22
  end
13
23
 
14
24
  def report
@@ -22,6 +32,7 @@ class Chef
22
32
  @collector = GenesisCollector::Collector.new(@config.merge(chef_node: run_context.node))
23
33
  @collector.collect!
24
34
  rescue => e
35
+ Bugsnag.notify(e) if defined?(Bugsnag)
25
36
  Chef::Log.error("Error collecting system information for Genesis:\n" + e.message)
26
37
  Chef::Log.error(e.backtrace.join("\n"))
27
38
  end
@@ -29,6 +40,7 @@ class Chef
29
40
  def send_report
30
41
  @collector.submit!
31
42
  rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT => e
43
+ Bugsnag.notify(e) if defined?(Bugsnag)
32
44
  Chef::Log.error("Could not connect to Genesis. Connection error:\n" + e.message)
33
45
  Chef::Log.error(e.backtrace.join("\n"))
34
46
  end
@@ -6,7 +6,7 @@ module GenesisCollector
6
6
  def collect_network_interfaces
7
7
  interfaces = {}
8
8
  Socket.getifaddrs.each do |ifaddr|
9
- next if ifaddr.name.start_with?('lo')
9
+ next if ifaddr.name.start_with?('lo', 'docker', 'veth')
10
10
  interfaces[ifaddr.name] ||= {}
11
11
  interfaces[ifaddr.name][:addresses] ||= []
12
12
  next unless ifaddr.addr.ipv4?
@@ -1,3 +1,3 @@
1
1
  module GenesisCollector
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genesis_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Radcliffe