summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-05-27 16:06:53 -0700
committerJohn Keiser <john@johnkeiser.com>2015-06-23 14:42:27 -0700
commitb927d174e192fb67264f432be2220fc67a50aacf (patch)
tree7b0a72dd5f99910ecc69cba440f3d9d8c366d308
parent82ecae4cbf8bb7924da972576f23cfd267282018 (diff)
downloadchef-b927d174e192fb67264f432be2220fc67a50aacf.tar.gz
Add default_action and allowed_actions to Resource class, remove from LWRP
-rw-r--r--lib/chef/resource/breakpoint.rb2
-rw-r--r--lib/chef/resource/cookbook_file.rb2
-rw-r--r--lib/chef/resource/cron.rb3
-rw-r--r--lib/chef/resource/directory.rb3
-rw-r--r--lib/chef/resource/group.rb3
-rw-r--r--lib/chef/resource/mdadm.rb3
-rw-r--r--lib/chef/resource/mount.rb3
-rw-r--r--lib/chef/resource/reboot.rb2
-rw-r--r--lib/chef/resource/user.rb3
-rw-r--r--spec/integration/recipes/recipe_dsl_spec.rb1
10 files changed, 25 insertions, 0 deletions
diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb
index 69dbc48050..05bae1a68b 100644
--- a/lib/chef/resource/breakpoint.rb
+++ b/lib/chef/resource/breakpoint.rb
@@ -24,6 +24,8 @@ class Chef
class Breakpoint < Chef::Resource
default_action :break
+ default_action :break
+
def initialize(action="break", *args)
super(caller.first, *args)
end
diff --git a/lib/chef/resource/cookbook_file.rb b/lib/chef/resource/cookbook_file.rb
index 42f16e6db6..69533e1751 100644
--- a/lib/chef/resource/cookbook_file.rb
+++ b/lib/chef/resource/cookbook_file.rb
@@ -29,6 +29,8 @@ class Chef
default_action :create
+ default_action :create
+
def initialize(name, run_context=nil)
super
@provider = Chef::Provider::CookbookFile
diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb
index 93cf41bc37..5560905f32 100644
--- a/lib/chef/resource/cron.rb
+++ b/lib/chef/resource/cron.rb
@@ -30,6 +30,9 @@ class Chef
default_action :create
allowed_actions :create, :delete
+ default_action :create
+ allowed_actions :create, :delete
+
def initialize(name, run_context=nil)
super
@minute = "*"
diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb
index 9cac2ce243..82e9caedcd 100644
--- a/lib/chef/resource/directory.rb
+++ b/lib/chef/resource/directory.rb
@@ -35,6 +35,9 @@ class Chef
default_action :create
allowed_actions :create, :delete
+ default_action :create
+ allowed_actions :create, :delete
+
def initialize(name, run_context=nil)
super
@path = name
diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb
index 2e80f32fea..5c0b64a5eb 100644
--- a/lib/chef/resource/group.rb
+++ b/lib/chef/resource/group.rb
@@ -28,6 +28,9 @@ class Chef
allowed_actions :create, :remove, :modify, :manage
default_action :create
+ allowed_actions :create, :remove, :modify, :manage
+ default_action :create
+
def initialize(name, run_context=nil)
super
@group_name = name
diff --git a/lib/chef/resource/mdadm.rb b/lib/chef/resource/mdadm.rb
index b789fab155..283e8d61da 100644
--- a/lib/chef/resource/mdadm.rb
+++ b/lib/chef/resource/mdadm.rb
@@ -30,6 +30,9 @@ class Chef
default_action :create
allowed_actions :create, :assemble, :stop
+ default_action :create
+ allowed_actions :create, :assemble, :stop
+
def initialize(name, run_context=nil)
super
diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb
index 79986d127f..425dc5e71b 100644
--- a/lib/chef/resource/mount.rb
+++ b/lib/chef/resource/mount.rb
@@ -30,6 +30,9 @@ class Chef
default_action :mount
allowed_actions :mount, :umount, :remount, :enable, :disable
+ default_action :mount
+ allowed_actions :mount, :umount, :remount, :enable, :disable
+
def initialize(name, run_context=nil)
super
@mount_point = name
diff --git a/lib/chef/resource/reboot.rb b/lib/chef/resource/reboot.rb
index 401f2f338f..801c066881 100644
--- a/lib/chef/resource/reboot.rb
+++ b/lib/chef/resource/reboot.rb
@@ -26,6 +26,8 @@ class Chef
class Reboot < Chef::Resource
allowed_actions :request_reboot, :reboot_now, :cancel
+ allowed_actions :request_reboot, :reboot_now, :cancel
+
def initialize(name, run_context=nil)
super
@provider = Chef::Provider::Reboot
diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb
index b85b648c92..a0658a21df 100644
--- a/lib/chef/resource/user.rb
+++ b/lib/chef/resource/user.rb
@@ -28,6 +28,9 @@ class Chef
default_action :create
allowed_actions :create, :remove, :modify, :manage, :lock, :unlock
+ default_action :create
+ allowed_actions :create, :remove, :modify, :manage, :lock, :unlock
+
def initialize(name, run_context=nil)
super
@username = name
diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb
index 6bbb9a5c4c..486b24986f 100644
--- a/spec/integration/recipes/recipe_dsl_spec.rb
+++ b/spec/integration/recipes/recipe_dsl_spec.rb
@@ -56,6 +56,7 @@ describe "Recipe DSL methods" do
before(:context) {
class Chef::Resource::BackcompatThingy < Chef::Resource
+ resource_name 'backcompat_thingy'
default_action :create
end
class Chef::Provider::BackcompatThingy < Chef::Provider