Changeset 41

Show
Ignore:
Timestamp:
11/18/07 12:12:38 (12 months ago)
Author:
jweiss
Message:

fix #16 - do not scramble empty passwords

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/webistrano/logger.rb

    r1 r41  
    6565    # replaces deployment passwords in the message by 'XXXXX' 
    6666    def hide_passwords(message) 
    67       scrabbled_message = message 
     67      scrambled_message = message 
    6868       
    69       # scrabble non-prompt configs 
     69      # scramble non-prompt configs 
    7070      deployment.stage.non_prompt_configurations.each do |config| 
    71         scrabbled_message.gsub!(config.value, "XXXXXXXX") if config.name.match(/password/) 
     71        scrambled_message.gsub!(config.value, "XXXXXXXX") if ( config.name.match(/password/) && !config.value.to_s.strip.blank? ) 
    7272      end 
    7373       
    74       # scrabble prompt configs 
     74      # scramble prompt configs 
    7575      deployment.prompt_config.each do |k, v| 
    76         scrabbled_message.gsub!(v, "XXXXXXXX") if k.to_s.match(/password/) 
     76        scrambled_message.gsub!(v, "XXXXXXXX") if ( k.to_s.match(/password/) && !v.to_s.strip.blank?) 
    7777      end 
    7878       
    79       scrabbled_message 
     79      scrambled_message 
    8080    end 
    8181