mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-24 13:25:01 +00:00
added new hook before_die (#509)
* added new hook before_die before die, the script calls this hook in oder to execute extra user's operations * PR-509 - added new hook before_die - Added test cases --------- Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
This commit is contained in:
20
t/pt-online-schema-change/samples/plugins/before_die.pm
Normal file
20
t/pt-online-schema-change/samples/plugins/before_die.pm
Normal file
@@ -0,0 +1,20 @@
|
||||
package pt_online_schema_change_plugin;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
sub new {
|
||||
my ($class, %args) = @_;
|
||||
my $self = { %args };
|
||||
return bless $self, $class;
|
||||
}
|
||||
|
||||
sub before_die {
|
||||
my ($self, %args) = @_;
|
||||
print "PLUGIN before_die\n";
|
||||
print "Exit status: $args{exit_status}\n";
|
||||
}
|
||||
|
||||
1;
|
Reference in New Issue
Block a user