-# Copyright (c) 2010 Zmanda, Inc. All Rights Reserved.
+# Copyright (c) 2010-2012 Zmanda, Inc. All Rights Reserved.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 as published
-# by the Free Software Foundation.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
$res->{device}->status == $DEVICE_STATUS_SUCCESS) {
$label = $res->{device}->volume_label;
}
+ my $relabeled = !defined($label) || $label !~ /$self->{'labelstr'}/;
$self->_user_msg(slot_result => 1,
slot => $slot_scanned,
label => $label,
err => $err,
+ relabeled => $relabeled,
res => $res);
if ($res) {
my $f_type;
return $result_cb->($err, $res);
}
$label = $res->{'device'}->volume_label;
- if (!defined $label) {
+ if (!defined($label) || $label !~ /$self->{'labelstr'}/) {
$res->get_meta_label(finished_cb => $steps->{'got_meta_label'});
return;
}
err => $sl->{'device_error'},
slot => $slot);
return 0;
- } elsif ($dev_status & $DEVICE_STATUS_SUCCESS and
+ } elsif ($dev_status == $DEVICE_STATUS_SUCCESS and
$f_type == $Amanda::Header::F_TAPESTART and
$label !~ /$self->{'labelstr'}/) {
if (!$autolabel->{'other_config'}) {
$self->_user_msg(slot_result => 1,
- other_config => 1,
+ label => $label,
+ labelstr => $self->{'labelstr'},
+ does_not_match_labelstr => 1,
slot => $slot);
return 0;
}