summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-03-12 10:29:48 -0700
committerGitHub <noreply@github.com>2018-03-12 10:29:48 -0700
commitbe50f19b2d035aa49f0cdb52cf6fa51083ab85a1 (patch)
treec0b10acaf95350c3e14d073ee7741ec44d148844
parentfc7550fd5160170561731df5d9a9bda793a12c2f (diff)
parent60c0ea533b3f6645f66386758389125bd1ae987d (diff)
downloadchef-be50f19b2d035aa49f0cdb52cf6fa51083ab85a1.tar.gz
Merge pull request #6951 from chef/dsc_resource_reboot
Properly validate reboot_action in dsc_resource
-rw-r--r--lib/chef/resource/dsc_resource.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/chef/resource/dsc_resource.rb b/lib/chef/resource/dsc_resource.rb
index d7e866b092..9c703b81cc 100644
--- a/lib/chef/resource/dsc_resource.rb
+++ b/lib/chef/resource/dsc_resource.rb
@@ -56,7 +56,6 @@ class Chef
super
@properties = ToTextHash.new
@resource = nil
- @reboot_action = :nothing
end
def resource(value = nil)
@@ -100,13 +99,7 @@ class Chef
# If the set method of the DSC resource indicate that a reboot
# is necessary, reboot_action provides the mechanism for a reboot to
# be requested.
- def reboot_action(value = nil)
- if value
- @reboot_action = value
- else
- @reboot_action
- end
- end
+ property :reboot_action, Symbol, default: :nothing, equal_to: [:nothing, :reboot_now, :request_reboot]
property :timeout, Integer