I didn't think run_method was an actor variable. I thought it was set
in the capistrano 'standard' script.

Plus wouldn't it be better if the 'add/remove' facility actually ran
in the context of the user on the machine. Then you can fire them off
in parallel.

Why log in as a user, sudo to root and then change to yet another user
to obtain data? Why not simply log in as the target user in the first
place and execute the necessary code as a pipeline in situ.

Meta-program a role list containing '[EMAIL PROTECTED], [EMAIL PROTECTED]' and
then just 'run "crontab -l"'

Plus if you want to use sudo on capture can't you simply have the
command

capture "sudo crontab -u fred -l"


On 14 Feb, 06:57, Mike Bailey <[EMAIL PROTECTED]> wrote:
> I've written a function for deprec to add/remove entries from users  
> crontabs.
> It needs sudo in order to grab the contents of other users crontabs  
> using 'capture'.
>
> I've created a patch to allow this. Does this look OK to be checked in?
>
> Should we be using the send method in functions rather than calling  
> 'put' or 'sudo' ?
> Alternatively should we make these sorts of functions  
> accept :sudo=true/false as an
> option so we can control it on a call by call basis?
>
> - Mike
>
> Index: lib/capistrano/actor.rb
> ===================================================================
> --- lib/capistrano/actor.rb     (revision 6149)
> +++ lib/capistrano/actor.rb     (working copy)
> @@ -294,7 +294,7 @@
>       # task, collects it's stdout into a string, and returns the  
> string.
>       def capture(command, options={})
>         output = ""
> -      run(command, options.merge(:once => true)) do |ch, stream, data|
> +      send(run_method, command, options.merge(:once => true)) do |
> ch, stream, data|
>           case stream
>           when :out then output << data
>           when :err then raise "error processing #{command.inspect}: #
> {data.inspect}"


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to