lib/percheron/actions/exec.rb in percheron-0.7.13 vs lib/percheron/actions/exec.rb in percheron-0.7.14

- old
+ new

@@ -10,11 +10,11 @@ @scripts = scripts @description = description end def execute! - $logger.debug "Executing #{description} #{scripts.inspect} on '#{unit.name}' unit" + $logger.debug "Executing #{description} #{scripts.inspect} on '#{unit.display_name}' unit" results = exec! results.compact.empty? ? nil : unit end private @@ -44,16 +44,16 @@ def execute_scripts! scripts.each do |script| in_working_directory(base_dir) do file = Pathname.new(File.expand_path(script, base_dir)) - execute_command!('/bin/sh /tmp/%s 2>&1' % file.basename) + execute_command!('/bin/sh -x /tmp/%s 2>&1' % file.basename) end end end def execute_command!(command) - $logger.info "Executing #{description} '#{command}' for '#{unit.name}' unit" + $logger.info "Executing #{description} '#{command}' for '#{unit.display_name}' unit" unit.container.exec(command.split(' ')) do |stream, out| $logger.debug '%s: %s' % [ stream, out.strip ] end end