summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-09-15 09:15:45 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-09-15 09:15:45 -0700
commit591fa4bf4ca725a3c3cdc918b3f8ed41482ca8ad (patch)
tree2d50566877f4aac07a6a6c644c99244cc6a7df0b
parent04665b527141ae1da0a7c950bbba2d2c0560b336 (diff)
downloadchef-591fa4bf4ca725a3c3cdc918b3f8ed41482ca8ad.tar.gz
move deprecation warnings to superclass
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/resource/user.rb14
-rw-r--r--lib/chef/resource/user/linux_user.rb13
2 files changed, 14 insertions, 13 deletions
diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb
index a07ce8b24b..06dfe95bd4 100644
--- a/lib/chef/resource/user.rb
+++ b/lib/chef/resource/user.rb
@@ -155,6 +155,20 @@ class Chef
:kind_of => [ TrueClass, FalseClass ]
)
end
+
+ def supports(args = {})
+ if args.key?(:manage_home)
+ Chef.log_deprecation "supports { manage_home: #{args[:manage_home]} } on the user resource is deprecated and will be removed in Chef 13, set manage_home: #{args[:manage_home]} instead"
+ end
+ if args.key?(:non_unique)
+ Chef.log_deprecation "supports { non_unique: #{args[:non_unique]} } on the user resource is deprecated and will be removed in Chef 13, set non_unique: #{args[:non_unique]} instead"
+ end
+ super
+ end
+
+ def supports=(args)
+ supports(args)
+ end
end
end
end
diff --git a/lib/chef/resource/user/linux_user.rb b/lib/chef/resource/user/linux_user.rb
index 5dbf22e360..ec60ac89bf 100644
--- a/lib/chef/resource/user/linux_user.rb
+++ b/lib/chef/resource/user/linux_user.rb
@@ -35,19 +35,6 @@ class Chef
@manage_home = false
end
- def supports(args = {})
- if args.key?(:manage_home)
- Chef.log_deprecation "supports { manage_home: #{args[:manage_home]} } on the user resource is deprecated and will be removed in Chef 13, set manage_home: #{args[:manage_home]} instead"
- end
- if args.key?(:non_unique)
- Chef.log_deprecation "supports { non_unique: #{args[:non_unique]} } on the user resource is deprecated and will be removed in Chef 13, set non_unique: #{args[:non_unique]} instead"
- end
- super
- end
-
- def supports=(args)
- supports(args)
- end
end
end
end