diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-01-24 05:52:13 -0800 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-01-24 05:52:13 -0800 |
commit | 50079b58192ed7a2af1ba6756f75084bc74d33e8 (patch) | |
tree | 7987d1ffdd223c97da2b10be11511978c711edc0 | |
parent | 1ac866a034ba37fb1fb4ed8a562d936751b43825 (diff) | |
parent | c9c6d96554e546f70a289522df3f24261674cc1c (diff) | |
download | puppet-vcsrepo-50079b58192ed7a2af1ba6756f75084bc74d33e8.tar.gz puppet-vcsrepo-50079b58192ed7a2af1ba6756f75084bc74d33e8.tar.bz2 |
Merge pull request #105 from mcanevet/no_su
Don't 'su' if passed user is current user
-rw-r--r-- | lib/puppet/provider/vcsrepo/git.rb | 2 | ||||
-rw-r--r-- | lib/puppet/provider/vcsrepo/hg.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb index cdae459..c96095b 100644 --- a/lib/puppet/provider/vcsrepo/git.rb +++ b/lib/puppet/provider/vcsrepo/git.rb @@ -318,7 +318,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo) return ret end - elsif @resource.value(:user) + elsif @resource.value(:user) and @resource.value(:user) != Facter['id'].value su(@resource.value(:user), '-c', "git #{args.join(' ')}" ) else git(*args) diff --git a/lib/puppet/provider/vcsrepo/hg.rb b/lib/puppet/provider/vcsrepo/hg.rb index 4886b7a..33f1e6a 100644 --- a/lib/puppet/provider/vcsrepo/hg.rb +++ b/lib/puppet/provider/vcsrepo/hg.rb @@ -105,7 +105,7 @@ Puppet::Type.type(:vcsrepo).provide(:hg, :parent => Puppet::Provider::Vcsrepo) d if @resource.value(:identity) args += ["--ssh", "ssh -oStrictHostKeyChecking=no -oPasswordAuthentication=no -oKbdInteractiveAuthentication=no -oChallengeResponseAuthentication=no -i #{@resource.value(:identity)}"] end - if @resource.value(:user) + if @resource.value(:user) and @resource.value(:user) != Facter['id'].value args.map! { |a| if a =~ /\s/ then "'#{a}'" else a end } # Adds quotes to arguments with whitespaces. su(@resource.value(:user), '-c', "hg #{args.join(' ')}") else |