summaryrefslogtreecommitdiff
path: root/lib/chef/provider/user.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-05-10 13:58:45 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-05-10 13:58:45 -0700
commit8f5a6701c590abf01525e3ca64ed90f3adce497c (patch)
tree24c56d735937093d72ff47eb5130a78c133e2395 /lib/chef/provider/user.rb
parent79f5a8502787ba19ea8872349bc4b167d7abb900 (diff)
downloadchef-8f5a6701c590abf01525e3ca64ed90f3adce497c.tar.gz
move should_set? to superclass
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/user.rb')
-rw-r--r--lib/chef/provider/user.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/chef/provider/user.rb b/lib/chef/provider/user.rb
index 18cf2d4d99..b27839bbcf 100644
--- a/lib/chef/provider/user.rb
+++ b/lib/chef/provider/user.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2017, Chef Software Inc.
+# Copyright:: Copyright 2008-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -199,6 +199,11 @@ class Chef
def check_lock
raise NotImplementedError
end
+
+ # helper used by e.g. linux, aix, solaris providers
+ def should_set?(sym)
+ current_resource.send(sym).to_s != new_resource.send(sym).to_s && new_resource.send(sym)
+ end
end
end
end