Skip to content

Commit

Permalink
* perl/Amanda/Changer/robot.pm (verify_unlocked): Reload the state and
Browse files Browse the repository at this point in the history
  use eject_unload


git-svn-id: https://svn.code.sf.net/p/amanda/code/amanda/trunk@6255 a8d146d6-cc15-0410-8900-af154a0219e0
  • Loading branch information
Jean-Louis Martineau committed Jun 16, 2015
1 parent a33d9b8 commit a67d92e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2015-06-16 Jean-Louis Martineau <martineau@zmanda.com>
* perl/Amanda/Changer/robot.pm (verify_unlocked): Reload the state and
use eject_unload

2015-06-15 Jean-Louis Martineau <martineau@zmanda.com>
* application-src/ampgsql.pl: Take another tar of ./pg_tblspc by
keeping the symlink.
Expand Down
27 changes: 25 additions & 2 deletions perl/Amanda/Changer/robot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1686,9 +1686,10 @@ sub verify_unlocked {
step verify_all_unloaded => sub {
my ($newstate) = @_;

if (UNIVERSAL::isa($state, 'Amanda::Changer::Error')) {
if (UNIVERSAL::isa($newstate, 'Amanda::Changer::Error')) {
return $params{'finished_cb'}->($newstate);
}
$state = $newstate;

my @loaded_drive;

Expand Down Expand Up @@ -1855,10 +1856,32 @@ sub verify_unlocked {
};

step unload => sub {
$self->{'interface'}->unload($drive, $slot, $steps->{'unload_done'});
$state->{'last_status'} = 0;
$state->{'last_operation_time'} = 0;
$params{'finished_get_state_cb'} = $steps->{'unload_new_state'};
return $self->_get_state(\%params);
};

step unload_new_state => sub {
my ($newstate) = @_;

if (UNIVERSAL::isa($newstate, 'Amanda::Changer::Error')) {
return $params{'finished_cb'}->($newstate);
}
$state = $newstate;

return $self->eject_unlocked(drive => $drive,
state => $state,
finished_cb => $steps->{'unload_done'});
};

step unload_done => sub {
my ($err) = @_;

if ($err) {
debug("ERROR: $err");
push @results, "ERROR: $err";
}
return $steps->{'verify_a_drive'}->();
};

Expand Down

0 comments on commit a67d92e

Please sign in to comment.