mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-20 01:16:14 +00:00
PXB-1615 WIP Updates for Percona XtraBackup
Changes made should be working but to properly test them, I need to set up a development API with the new items for XtraBackup in the DB.
This commit is contained in:
@@ -153,14 +153,16 @@ sub version_check {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PTDEBUG && _d('Using', $protocol);
|
PTDEBUG && _d('Using', $protocol);
|
||||||
|
my $url = $args{url} # testing
|
||||||
|
|| $ENV{PERCONA_VERSION_CHECK_URL} # testing
|
||||||
|
|| "$protocol://v.percona.com";
|
||||||
|
PTDEBUG && _d('API URL:', $url);
|
||||||
|
|
||||||
# Get list of programs to check from Percona.
|
# Get list of programs to check from Percona.
|
||||||
my $advice = pingback(
|
my $advice = pingback(
|
||||||
instances => $instances_to_check,
|
instances => $instances_to_check,
|
||||||
protocol => $protocol,
|
protocol => $protocol,
|
||||||
url => $args{url} # testing
|
url => $url,
|
||||||
|| $ENV{PERCONA_VERSION_CHECK_URL} # testing
|
|
||||||
|| "$protocol://v.percona.com",
|
|
||||||
);
|
);
|
||||||
if ( $advice ) {
|
if ( $advice ) {
|
||||||
PTDEBUG && _d('Advice:', Dumper($advice));
|
PTDEBUG && _d('Advice:', Dumper($advice));
|
||||||
@@ -342,9 +344,14 @@ sub get_uuid {
|
|||||||
my $filename = $ENV{"HOME"} . $uuid_file;
|
my $filename = $ENV{"HOME"} . $uuid_file;
|
||||||
my $uuid = _generate_uuid();
|
my $uuid = _generate_uuid();
|
||||||
|
|
||||||
open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
|
my $fh;
|
||||||
print $fh $uuid;
|
eval {
|
||||||
close $fh;
|
open($fh, '>', $filename);
|
||||||
|
};
|
||||||
|
if (!$EVAL_ERROR) {
|
||||||
|
print $fh $uuid;
|
||||||
|
close $fh;
|
||||||
|
}
|
||||||
|
|
||||||
return $uuid;
|
return $uuid;
|
||||||
}
|
}
|
||||||
@@ -434,8 +441,9 @@ sub pingback {
|
|||||||
general_id => get_uuid(),
|
general_id => get_uuid(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my $tool_name = $ENV{XTRABACKUP_VERSION} ? "Percona XtraBackup" : File::Basename::basename($0);
|
||||||
my $client_response = {
|
my $client_response = {
|
||||||
headers => { "X-Percona-Toolkit-Tool" => File::Basename::basename($0) },
|
headers => { "X-Percona-Toolkit-Tool" => $tool_name },
|
||||||
content => $client_content,
|
content => $client_content,
|
||||||
};
|
};
|
||||||
PTDEBUG && _d('Client response:', Dumper($client_response));
|
PTDEBUG && _d('Client response:', Dumper($client_response));
|
||||||
@@ -528,6 +536,7 @@ my %sub_for_type = (
|
|||||||
perl_version => \&get_perl_version,
|
perl_version => \&get_perl_version,
|
||||||
perl_module_version => \&get_perl_module_version,
|
perl_module_version => \&get_perl_module_version,
|
||||||
mysql_variable => \&get_mysql_variable,
|
mysql_variable => \&get_mysql_variable,
|
||||||
|
xtrabackup => \&get_xtrabackup_version,
|
||||||
);
|
);
|
||||||
|
|
||||||
sub valid_item {
|
sub valid_item {
|
||||||
@@ -659,6 +668,10 @@ sub get_perl_version {
|
|||||||
return $version;
|
return $version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub get_xtrabackup_version {
|
||||||
|
return $ENV{XTRABACKUP_VERSION};
|
||||||
|
}
|
||||||
|
|
||||||
sub get_perl_module_version {
|
sub get_perl_module_version {
|
||||||
my (%args) = @_;
|
my (%args) = @_;
|
||||||
my $item = $args{item};
|
my $item = $args{item};
|
||||||
|
Reference in New Issue
Block a user