dumblog-chef 0.1.0 → 0.3.0

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,17 +1,17 @@
1
1
  ---
2
2
  !binary "U0hBMjU2":
3
3
  metadata.gz: !binary |-
4
- Mzk0OTc3ODA0YTJmNGM4NzFiNmI2NDM0MDEwODE1NDdlMzg0MzY1NDg2Yzg2
5
- OTlhMDczYmMxYzVmNDk3ZmQ2Ng==
4
+ ZmZlZGY5YTExMTk5YTljOTI0ODVjM2E2ZGMyZWRmNzdkZWFjNTZhOWVjODA1
5
+ YzcyYmJjNzA1YzI3NDA1NjE0ZQ==
6
6
  data.tar.gz: !binary |-
7
- NWUzZjQ2NGRiN2MxNWNhY2Q4ZjRlOWU5ZmYzNTliMDkwNmYwMjAzYTc1ZDNj
8
- MzhjMDk2NzM0M2UwZGRjZjk1NQ==
7
+ ODY0NDgwMTkyZWY0NGUyM2U1NDE1OWNmZmZhZmM5MTRjMzg2MjFkYTAwYzI0
8
+ NjIyNGM1ZDU3NzY1ZTUyNzlmOQ==
9
9
  SHA512:
10
10
  metadata.gz: !binary |-
11
- N2U2Y2E3YjgwZjllNzAzNDkwYTc4OGEyOGM3MTNlMWU0MTQ5YWI1MTk3OGI1
12
- OTFlNTM3NWNlNjQyOTRiZGY4Njk1MDY1M2E5ZmY5NzkzNGM3ZGRiMDdmYzRk
13
- NmFmOTMxNmMxYjE3ODczMjc1MzQwZTg0MjMyZjY5ODdjZDgyZGM=
11
+ NWZmMGI3ZTE1MDE3YTA4MTA4ZjY4ZjU5YTcxYjlkMDllYzZjNDYzM2E5MWRk
12
+ OTA2YTY4Y2Q3OGU5N2JhYzJiNDE2NjFlMWJlY2EwZmE1NWY4Y2VkYjZmMDkx
13
+ MmRhNDU1Y2IyMDlhMWY5ZTdlZTMyZWRmZjk0NTEwYzBiYWRjYWY=
14
14
  data.tar.gz: !binary |-
15
- YTEzZjg4MjliMWQwMWI3MDIyZDFmMDc5M2FkYjYzNDkyNmZkMWIxYmVlNDA5
16
- OGM5MzRlMjBiMWM0ODdjZmFiYTZjOTFiYjY2M2RkNDY5NjEyMmVmYjZhZGQ4
17
- ODczZDVmZGRhMjJlY2IxNzVmODE2ODIwNDk2MTNiYWM3YmJlODQ=
15
+ NzY0YzMxZWYyMTMyOGUzNmYxZjBhZDczNmEwZjJmNmVmZWNmMDY0YjgzMjdj
16
+ YzY3NmViMzhiMzk0NTgwZTRhYjdmYTgxYTllYzlhYmY4MzU5YjY3NjlmZWJh
17
+ YTQzOGI0NmZmMjM0ZTNkYzE1YjJlOThlMTUzNzg5ZGI0NjM0ZTI=
@@ -1,5 +1,17 @@
1
1
  dumblog-chef Changelog
2
- ================
2
+ ======================
3
+
4
+ 0.3.0
5
+ ---
6
+ - Refactored code
7
+ - default AWS region is `us-west-2`
8
+ - Added backwards compatible support for:
9
+ - Ability to pass AWS region to the go-dumblog utility
10
+ - Custom log group stream names
11
+
12
+ 0.2.0
13
+ ---
14
+ - The cake is a lie! (v0.2.0 yanked)
3
15
 
4
16
  0.1.0
5
17
  ---
@@ -2,18 +2,20 @@
2
2
 
3
3
  module DumblogChef
4
4
  class Handler < Chef::Handler
5
- attr_reader :group
5
+ attr_reader :time, :instance_id
6
+ attr_reader :group, :stream, :region
7
+
8
+ def initialize(group='/chef', stream=nil, region=nil)
9
+ @time = Time.now.utc
10
+ @instance_id = `wget -qO- http://169.254.169.254/latest/meta-data/instance-id`
6
11
 
7
- def initialize(group='/chef')
8
12
  @group = group
13
+ @stream = [nil, ''].include?(stream) ? "#{time.strftime("%Y/%m/%d")}/#{instance_id}" : stream
14
+ @region = [nil, ''].include?(region) ? 'us-west-2' : region
9
15
  end
10
16
 
11
17
  def report
12
18
  if run_status.failed?
13
- time = Time.now.utc
14
- instance_id = `wget -qO- http://169.254.169.254/latest/meta-data/instance-id`
15
- stream = "#{time.strftime("%Y/%m/%d")}/#{instance_id}"
16
-
17
19
  message = {}
18
20
  message[:subject] = "chef-client Run Failed"
19
21
  message[:time] = time.iso8601
@@ -26,7 +28,7 @@ module DumblogChef
26
28
  begin
27
29
  file.write message.to_json
28
30
  file.flush
29
- `for i in {1..5}; do dumblog -group #{group} -stream #{stream} $(cat #{file.path}) && break || sleep 15; done`
31
+ `for i in {1..5}; do dumblog -group #{group} -stream #{stream} -region #{region} $(cat #{file.path}) && break || sleep 15; done`
30
32
  ensure
31
33
  file.close
32
34
  file.unlink
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module DumblogChef
4
- VERSION = '0.1.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dumblog-chef
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Drew
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-17 00:00:00.000000000 Z
11
+ date: 2018-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef