event-reporting-handler 0.1.9 → 0.1.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d5765a39877a792875797aaca1801edeef9c7e2
|
4
|
+
data.tar.gz: f65fd0c4149d7d741aeb4a50c2cee6415850352f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d8ae76d4f609e95b750e71ad21aad9e08d8524fa15a7b2758c71ddba8a23e2f82e572bf38ca9aada790511e443c1390c1667881553fda3e5080353154359f1
|
7
|
+
data.tar.gz: e57d1e8fe8b73cac442f39c0d45e2bdffda0d3aca51f5042d75274fd0f087457351301b3c6d750f6de357f30d58b01c608fc7ebcebdf6180723c7474fd3bca2b
|
@@ -29,7 +29,7 @@ module BloombergLP
|
|
29
29
|
end
|
30
30
|
|
31
31
|
# Called at the end a successful Chef run.
|
32
|
-
def run_completed(
|
32
|
+
def run_completed(_node)
|
33
33
|
publish_event(:run_completed)
|
34
34
|
end
|
35
35
|
|
@@ -57,7 +57,7 @@ module BloombergLP
|
|
57
57
|
evt.id
|
58
58
|
end
|
59
59
|
|
60
|
-
def publish_event(event, custom_attributes)
|
60
|
+
def publish_event(event, custom_attributes = {})
|
61
61
|
json_to_publish = get_json_from_event(event, custom_attributes)
|
62
62
|
uri = URI(@http_url)
|
63
63
|
res = Net::HTTP.start(uri.host, uri.port) do |http|
|
@@ -72,8 +72,8 @@ module BloombergLP
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def get_json_from_event(event, custom_attributes)
|
75
|
-
|
76
|
-
|
75
|
+
deploy_event = { node_fqdn: @node_fqdn, sub_type: event, occurred_at: Time.now.to_s }.merge(custom_attributes)
|
76
|
+
{ deploy_event: deploy_event }.to_json
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|