summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-06-25 15:38:03 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-06-25 18:14:58 -0700
commite817ad1d1ac26c5299f373ec5d7e997f644baec7 (patch)
tree16ce6ad2c4d5c0edcbaff510464d28bfd3cb1582
parente5478d4ff0510e637ecec69f8b2fc7ef844ba5c0 (diff)
Fix tests broken by level-violation fix
-rw-r--r--lib/puppet/provider/user/useradd.rb9
-rwxr-xr-xspec/unit/type/user_spec.rb2
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/puppet/provider/user/useradd.rb b/lib/puppet/provider/user/useradd.rb
index 15b3b1379..fc5eabcbc 100644
--- a/lib/puppet/provider/user/useradd.rb
+++ b/lib/puppet/provider/user/useradd.rb
@@ -60,11 +60,12 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
# Retrieve the password using the Shadow Password library
def password
- if ent = Shadow::Passwd.getspnam(@resource.name)
- return ent.sp_pwdp
- else
- return :absent
+ if Puppet.features.libshadow?
+ if ent = Shadow::Passwd.getspnam(@resource.name)
+ return ent.sp_pwdp
+ end
end
+ return :absent
end
end
diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb
index 3d4d49dca..590b35a94 100755
--- a/spec/unit/type/user_spec.rb
+++ b/spec/unit/type/user_spec.rb
@@ -265,9 +265,7 @@ describe user do
describe "when user has roles" do
it "should autorequire roles" do
- #this is a little funky because the autorequire depends on a property with a feature
testuser = Puppet::Type.type(:user).new(:name => "testuser")
- testuser.provider.class.expects(:feature?).with(:manages_solaris_rbac).returns(true)
testuser[:roles] = "testrole"
testrole = Puppet::Type.type(:user).new(:name => "testrole")