summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2019-11-18 11:17:53 -0800
committerTim Smith <tsmith84@gmail.com>2019-11-18 11:17:53 -0800
commit4cbe09bcc1b37d5b5b6112566e5bc6270d00530b (patch)
tree4683f8e6f95326326a2f91e17093bab9eab6df12
parent46469dbe967873494cae3dc0c75e3b5b368138da (diff)
downloadchef-4cbe09bcc1b37d5b5b6112566e5bc6270d00530b.tar.gz
Fix spec failures by moving default_action
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/reboot.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index 8c83b1dec4..7af55dd242 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -1,6 +1,6 @@
#
# Author:: Chris Doherty <cdoherty@chef.io>)
-# Copyright:: Copyright 2014-2018, Chef, Inc.
+# Copyright:: Copyright 2014-2019, Chef, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,8 +35,6 @@ class Chef
" probably undesired results."
introduced "12.0"
- default_action :nothing # make sure people are quite clear what they want
-
property :reason, String,
description: "A string that describes the reboot action.",
default: "Reboot by #{Chef::Dist::PRODUCT}"
@@ -73,6 +71,11 @@ class Chef
end
end
+ # make sure people are quite clear what they want
+ # we have to define this below the actions since setting default_action to :nothing is a no-op
+ # and doesn't actually override the first action in the resource
+ default_action :nothing
+
action_class do
# add a reboot to the node run_context
# @return [void]