diff --git a/chefctl/sample_hooks/custom_attrs.rb b/chefctl/sample_hooks/custom_attrs.rb index 7d5abe8..b65c66a 100644 --- a/chefctl/sample_hooks/custom_attrs.rb +++ b/chefctl/sample_hooks/custom_attrs.rb @@ -23,6 +23,7 @@ # documentation for descriptions of each method. require 'json' +require 'tempfile' module CustomAttributes def initialize @@ -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