mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-20 10:55:01 +00:00
Remove trailing spaces (#665)
* Remove trailing spaces * PR-665 - Remove trailing spaces - Updated not stable test t/pt-online-schema-change/preserve_triggers.t - Updated utilities in bin directory * PR-665 - Remove trailing spaces - Fixed typos * PR-665 - Remove trailing spaces - Fixed typos --------- Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
This commit is contained in:
@@ -160,7 +160,7 @@ sub new {
|
||||
rules => [], # desc of rules for --help
|
||||
mutex => [], # rule: opts are mutually exclusive
|
||||
atleast1 => [], # rule: at least one opt is required
|
||||
disables => {}, # rule: opt disables other opts
|
||||
disables => {}, # rule: opt disables other opts
|
||||
defaults_to => {}, # rule: opt defaults to value of other opt
|
||||
DSNParser => undef,
|
||||
default_files => [
|
||||
@@ -323,7 +323,7 @@ sub _pod_to_specs {
|
||||
}
|
||||
|
||||
push @specs, {
|
||||
spec => $self->{parse_attributes}->($self, $option, \%attribs),
|
||||
spec => $self->{parse_attributes}->($self, $option, \%attribs),
|
||||
desc => $para
|
||||
. (defined $attribs{default} ? " (default $attribs{default})" : ''),
|
||||
group => ($attribs{'group'} ? $attribs{'group'} : 'default'),
|
||||
@@ -414,7 +414,7 @@ sub _parse_specs {
|
||||
$self->{opts}->{$long} = $opt;
|
||||
}
|
||||
else { # It's an option rule, not a spec.
|
||||
PTDEBUG && _d('Parsing rule:', $opt);
|
||||
PTDEBUG && _d('Parsing rule:', $opt);
|
||||
push @{$self->{rules}}, $opt;
|
||||
my @participants = $self->_get_participants($opt);
|
||||
my $rule_ok = 0;
|
||||
@@ -459,7 +459,7 @@ sub _parse_specs {
|
||||
PTDEBUG && _d('Option', $long, 'disables', @participants);
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
sub _get_participants {
|
||||
@@ -546,7 +546,7 @@ sub _set_option {
|
||||
}
|
||||
|
||||
sub get_opts {
|
||||
my ( $self ) = @_;
|
||||
my ( $self ) = @_;
|
||||
|
||||
foreach my $long ( keys %{$self->{opts}} ) {
|
||||
$self->{opts}->{$long}->{got} = 0;
|
||||
@@ -677,7 +677,7 @@ sub _check_opts {
|
||||
else {
|
||||
$err = join(', ',
|
||||
map { "--$self->{opts}->{$_}->{long}" }
|
||||
grep { $_ }
|
||||
grep { $_ }
|
||||
@restricted_opts[0..scalar(@restricted_opts) - 2]
|
||||
)
|
||||
. ' or --'.$self->{opts}->{$restricted_opts[-1]}->{long};
|
||||
@@ -687,7 +687,7 @@ sub _check_opts {
|
||||
}
|
||||
|
||||
}
|
||||
elsif ( $opt->{is_required} ) {
|
||||
elsif ( $opt->{is_required} ) {
|
||||
$self->save_error("Required option --$long must be specified");
|
||||
}
|
||||
|
||||
@@ -1071,7 +1071,7 @@ sub clone {
|
||||
$clone{$scalar} = $self->{$scalar};
|
||||
}
|
||||
|
||||
return bless \%clone;
|
||||
return bless \%clone;
|
||||
}
|
||||
|
||||
sub _parse_size {
|
||||
@@ -1585,7 +1585,7 @@ sub extends {
|
||||
|
||||
sub _load_module {
|
||||
my ($class) = @_;
|
||||
|
||||
|
||||
(my $file = $class) =~ s{::|'}{/}g;
|
||||
$file .= '.pm';
|
||||
{ local $@; eval { require "$file" } } # or warn $@;
|
||||
@@ -1616,7 +1616,7 @@ sub has {
|
||||
my $caller = scalar caller();
|
||||
|
||||
my $class_metadata = Lmo::Meta->metadata_for($caller);
|
||||
|
||||
|
||||
for my $attribute ( ref $names ? @$names : $names ) {
|
||||
my %args = @_;
|
||||
my $method = ($args{is} || '') eq 'ro'
|
||||
@@ -1635,16 +1635,16 @@ sub has {
|
||||
|
||||
if ( my $type_check = $args{isa} ) {
|
||||
my $check_name = $type_check;
|
||||
|
||||
|
||||
if ( my ($aggregate_type, $inner_type) = $type_check =~ /\A(ArrayRef|Maybe)\[(.*)\]\z/ ) {
|
||||
$type_check = Lmo::Types::_nested_constraints($attribute, $aggregate_type, $inner_type);
|
||||
}
|
||||
|
||||
|
||||
my $check_sub = sub {
|
||||
my ($new_val) = @_;
|
||||
Lmo::Types::check_type_constraints($attribute, $type_check, $check_name, $new_val);
|
||||
};
|
||||
|
||||
|
||||
$class_metadata->{$attribute}{isa} = [$check_name, $check_sub];
|
||||
my $orig_method = $method;
|
||||
$method = sub {
|
||||
@@ -1946,7 +1946,7 @@ sub parse {
|
||||
foreach my $key ( keys %$opts ) {
|
||||
PTDEBUG && _d('Finding value for', $key);
|
||||
$final_props{$key} = $given_props{$key};
|
||||
if ( !defined $final_props{$key}
|
||||
if ( !defined $final_props{$key}
|
||||
&& defined $prev->{$key} && $opts->{$key}->{copy} )
|
||||
{
|
||||
$final_props{$key} = $prev->{$key};
|
||||
@@ -2086,7 +2086,7 @@ sub get_dbh {
|
||||
my $dbh;
|
||||
my $tries = 2;
|
||||
while ( !$dbh && $tries-- ) {
|
||||
PTDEBUG && _d($cxn_string, ' ', $user, ' ', $pass,
|
||||
PTDEBUG && _d($cxn_string, ' ', $user, ' ', $pass,
|
||||
join(', ', map { "$_=>$defaults->{$_}" } keys %$defaults ));
|
||||
|
||||
$dbh = eval { DBI->connect($cxn_string, $user, $pass, $defaults) };
|
||||
@@ -2284,7 +2284,7 @@ sub set_vars {
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
sub _d {
|
||||
@@ -2557,7 +2557,7 @@ sub run {
|
||||
$parent_exit->($child_pid) if $parent_exit;
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
||||
POSIX::setsid() or die "Cannot start a new session: $OS_ERROR";
|
||||
chdir '/' or die "Cannot chdir to /: $OS_ERROR";
|
||||
|
||||
@@ -2583,7 +2583,7 @@ sub run {
|
||||
|
||||
close STDERR;
|
||||
open STDERR, ">&STDOUT"
|
||||
or die "Cannot dupe STDERR to STDOUT: $OS_ERROR";
|
||||
or die "Cannot dupe STDERR to STDOUT: $OS_ERROR";
|
||||
}
|
||||
else {
|
||||
if ( -t STDOUT ) {
|
||||
@@ -2621,7 +2621,7 @@ sub _make_pid_file {
|
||||
eval {
|
||||
sysopen(PID_FH, $pid_file, O_RDWR|O_CREAT|O_EXCL) or die $OS_ERROR;
|
||||
print PID_FH $PID, "\n";
|
||||
close PID_FH;
|
||||
close PID_FH;
|
||||
};
|
||||
if ( my $e = $EVAL_ERROR ) {
|
||||
if ( $e =~ m/file exists/i ) {
|
||||
@@ -2792,7 +2792,7 @@ sub new {
|
||||
};
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
|
||||
sub get_items {
|
||||
my ( $self, $section ) = @_;
|
||||
return $section ? $self->{items}->{$section} : $self->{items};
|
||||
@@ -2831,7 +2831,7 @@ sub parse_from_file {
|
||||
|
||||
sub command {
|
||||
my ( $self, $cmd, $name ) = @_;
|
||||
|
||||
|
||||
$name =~ s/\s+\Z//m; # Remove \n and blank line after name.
|
||||
|
||||
if ( $cmd eq 'head1' ) {
|
||||
@@ -2866,7 +2866,7 @@ sub command {
|
||||
else {
|
||||
$self->{current_section} = '';
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3647,7 +3647,7 @@ sub get_rules {
|
||||
return _var_gt($args{variables}->{relay_log_space_limit}, 0);
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id => 'slave_net_timeout',
|
||||
code => sub {
|
||||
@@ -4122,7 +4122,7 @@ sub _split_url {
|
||||
or die(qq/SSL certificate not valid for $host\n/);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$self->{host} = $host;
|
||||
$self->{port} = $port;
|
||||
|
||||
@@ -4597,7 +4597,7 @@ my @vc_dirs = (
|
||||
}
|
||||
PTDEBUG && _d('Version check file', $file, 'in', $ENV{PWD});
|
||||
return $file; # in the CWD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub version_check_time_limit {
|
||||
@@ -4614,11 +4614,11 @@ sub version_check {
|
||||
PTDEBUG && _d('FindBin::Bin:', $FindBin::Bin);
|
||||
if ( !$args{force} ) {
|
||||
if ( $FindBin::Bin
|
||||
&& (-d "$FindBin::Bin/../.bzr" ||
|
||||
&& (-d "$FindBin::Bin/../.bzr" ||
|
||||
-d "$FindBin::Bin/../../.bzr" ||
|
||||
-d "$FindBin::Bin/../.git" ||
|
||||
-d "$FindBin::Bin/../../.git"
|
||||
)
|
||||
-d "$FindBin::Bin/../.git" ||
|
||||
-d "$FindBin::Bin/../../.git"
|
||||
)
|
||||
) {
|
||||
PTDEBUG && _d("$FindBin::Bin/../.bzr disables --version-check");
|
||||
return;
|
||||
@@ -4642,7 +4642,7 @@ sub version_check {
|
||||
PTDEBUG && _d(scalar @$instances_to_check, 'instances to check');
|
||||
return unless @$instances_to_check;
|
||||
|
||||
my $protocol = 'https';
|
||||
my $protocol = 'https';
|
||||
eval { require IO::Socket::SSL; };
|
||||
if ( $EVAL_ERROR ) {
|
||||
PTDEBUG && _d($EVAL_ERROR);
|
||||
@@ -4826,7 +4826,7 @@ sub get_uuid {
|
||||
}
|
||||
|
||||
return $uuid;
|
||||
}
|
||||
}
|
||||
|
||||
sub _generate_uuid {
|
||||
return sprintf+($}="%04x")."$}-$}-$}-$}-".$}x3,map rand 65537,0..7;
|
||||
@@ -4875,7 +4875,7 @@ sub pingback {
|
||||
);
|
||||
die "Failed to parse server requested programs: $response->{content}"
|
||||
if !scalar keys %$items;
|
||||
|
||||
|
||||
my $versions = get_versions(
|
||||
items => $items,
|
||||
instances => $instances,
|
||||
@@ -5140,7 +5140,7 @@ sub get_from_mysql {
|
||||
if ($item->{item} eq 'MySQL' && $item->{type} eq 'mysql_variable') {
|
||||
@{$item->{vars}} = grep { $_ eq 'version' || $_ eq 'version_comment' } @{$item->{vars}};
|
||||
}
|
||||
|
||||
|
||||
|
||||
my @versions;
|
||||
my %version_for;
|
||||
|
Reference in New Issue
Block a user