Permalink
Browse files

Clearing out cobwebs

  • Loading branch information...
1 parent 1e36c3a commit a5f763d4d9c343df7555fd028703d15bbf3dfc71 @aphyr committed Apr 14, 2013
Showing with 6 additions and 4 deletions.
  1. +3 −3 bin/salticid
  2. +3 −1 lib/salticid/host.rb
View
6 bin/salticid
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby1.8
+#!/usr/bin/env ruby
require 'rubygems'
require 'trollop'
@@ -37,7 +37,7 @@ hosts.flatten!.uniq!
# If no hosts were given, we may infer them from the task.
if hosts.empty?
- hosts |= @h.hosts_for(task) rescue nil
+ hosts |= @h.hosts_for(task) rescue []
end
# Show info
@@ -79,7 +79,7 @@ begin
end
# Run task
- host.instance_eval task if task
+ host.instance_eval(task, "command line") if task
host.log :finished, "Finished."
rescue => e
View
4 lib/salticid/host.rb
@@ -163,7 +163,9 @@ def exec!(command, opts = {}, &block)
# If applicable, wrap the command in a sudo subshell...
if @sudo
command = "sudo -S -u #{@sudo} bash -c #{escape(command)}"
- opts[:stdin] = @password + "\n" + opts[:stdin].to_s
+ if @password
+ opts[:stdin] = @password + "\n" + opts[:stdin].to_s
+ end
end
buffer = ''

0 comments on commit a5f763d

Please sign in to comment.