event-reporting-handler 0.1.15 → 0.1.16
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f01111a0b1b7cf0947d0aacc891cb428a161b5f
|
4
|
+
data.tar.gz: 2bdd9abf423878f141d4fc46a329c2207db6dbac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1e9ef712ad93fbc891f2b8eefc6478e983de0b47cb342a590591adc39af217b1ff7802387b08c85f12367688d34ff13cae0520418c80839974349090d1382bf
|
7
|
+
data.tar.gz: d75259c33efbeedaae5f54b3ce24dca59cd5f4bfb3bd68d9784933117fb9cdf5f10b24b04fd45f146f7906bedcf3a122a41b780626b81269089a5f0c6b5e6c67
|
@@ -62,15 +62,19 @@ module BloombergLP
|
|
62
62
|
|
63
63
|
def publish_event(event, custom_attributes = {})
|
64
64
|
json_to_publish = get_json_from_event(event, custom_attributes.merge(@whitelist_attributes))
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
65
|
+
begin
|
66
|
+
uri = URI(@http_url)
|
67
|
+
res = Net::HTTP.start(uri.host, uri.port) do |http|
|
68
|
+
http.post(uri.path, json_to_publish, 'Content-Type' => 'application/json')
|
69
|
+
end
|
70
|
+
case res
|
71
|
+
when Net::HTTPSuccess, Net::HTTPRedirection
|
72
|
+
Chef::Log.debug("Successfully sent http request with #{json_to_publish} to #{@http_url}")
|
73
|
+
else
|
74
|
+
Chef::Log.warn("Error in sending http request to #{@http_url} Code is #{res.code} Msg is #{res.message}")
|
75
|
+
end
|
76
|
+
rescue StandardError => e # catch all exceptions so that chef run does not fail
|
77
|
+
Chef::Log.warn("Exception raised when sending http request to #{@http_url} : #{e}")
|
74
78
|
end
|
75
79
|
end
|
76
80
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event-reporting-handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shahul Khajamohideen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|