Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion chefctl/sample_hooks/custom_attrs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# documentation for descriptions of each method.

require 'json'
require 'tempfile'

module CustomAttributes
def initialize
Expand All @@ -41,7 +42,7 @@ def cli_options(parser)

def pre_start
if @custom_attr
@tmp_file = Tmpfile.new('attributes')
@tmp_file = Tempfile.new('attributes')
attrs = { 'custom_attributes' => @custom_attr }
@tmp_file.write(JSON.generate(attrs))
@tmp_file.close
Expand Down
Loading