~hingo/percona-toolkit/pqd-mongodb-24

« back to all changes in this revision

Viewing changes to bin/pt-kill

  • Committer: Daniel Nichter
  • Date: 2013-03-13 18:38:45 UTC
  • Revision ID: daniel@percona.com-20130313183845-qka3b8qx14yrqgw4
Fix lib/Cxn.pm that didn't merge correctly.  Fix t/lib/OptionParser.t test failure.  Update Cxn, OptionParser, and DSNParser in all tools.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5054
5054
      $dsn = $dp->copy($prev_dsn, $dsn);
5055
5055
   }
5056
5056
 
 
5057
   my $dsn_name = $dp->as_string($dsn, [qw(h P S)])
 
5058
               || $dp->as_string($dsn, [qw(F)])
 
5059
               || '';
 
5060
 
5057
5061
   my $self = {
5058
5062
      dsn             => $dsn,
5059
5063
      dbh             => $args{dbh},
5060
 
      dsn_name        => $dp->as_string($dsn, [qw(h P S)]),
 
5064
      dsn_name        => $dsn_name,
5061
5065
      hostname        => '',
5062
5066
      set             => $args{set},
5063
5067
      NAME_lc         => defined($args{NAME_lc}) ? $args{NAME_lc} : 1,
5064
5068
      dbh_set         => 0,
5065
 
      OptionParser    => $o,
 
5069
      ask_pass        => $o->get('ask-pass'),
5066
5070
      DSNParser       => $dp,
5067
5071
      is_cluster_node => undef,
5068
5072
      parent          => $args{parent},
5075
5079
   my ( $self, %opts ) = @_;
5076
5080
   my $dsn = $self->{dsn};
5077
5081
   my $dp  = $self->{DSNParser};
5078
 
   my $o   = $self->{OptionParser};
5079
5082
 
5080
5083
   my $dbh = $self->{dbh};
5081
5084
   if ( !$dbh || !$dbh->ping() ) {
5082
 
      if ( $o->get('ask-pass') && !$self->{asked_for_pass} ) {
 
5085
      if ( $self->{ask_pass} && !$self->{asked_for_pass} ) {
5083
5086
         $dsn->{p} = OptionParser::prompt_noecho("Enter MySQL password: ");
5084
5087
         $self->{asked_for_pass} = 1;
5085
5088
      }