pref => $arg{pref}, # Pref object
bconsole => undef, # Expect object
log_stdout => $arg{log_stdout} || 0,
- timeout => $arg{debug} || 10,
+ timeout => $arg{timeout} || 20,
debug => $arg{debug} || 0,
};
my ($self, $how) = @_;
if ($self->{bconsole}) {
- $self->{bconsole}->log_stdout($how);
+ $self->{bconsole}->log_stdout($how);
}
-
+
$self->{log_stdout} = $how;
}
return $self->before();
}
-sub send_cmd_with_drive
-{
- my ($self, $cmd, $drive) = @_;
- $drive = $drive || '0';
-
- unless ($self->connect()) {
- return '';
- }
- $self->send("$cmd\n");
- $self->expect_it('-re', '\[0\]\s*:');
-
- $self->send("$drive\n");
- $self->expect_it('-re', '[0-9]');
- $self->{bconsole}->clear_accum();
- $self->expect_it('-re',qr/^[*]/);
- return $self->before();
-}
-
sub label_barcodes
{
my ($self, %arg) = @_;
sub update_slots
{
my ($self, $storage, $drive) = @_;
-
- return $self->send_cmd_with_drive("update slots storage=$storage", $drive);
+ $drive = $drive || 0;
+
+ return $self->send_cmd("update slots storage=$storage drive=$drive");
}
sub get_fileset
print "job : ", join(',', $c->list_job()), "\n";
print "storage : ", join(',', $c->list_storage()), "\n";
#print "prune : " . $c->prune_volume('000001'), "\n";
-#print "update : " . $c->send_cmd_with_drive('update slots storage=SDLT-1-2'), "\n";
+#print "update : " . $c->send_cmd('update slots storage=SDLT-1-2, drive=0'), "\n";
#print "label : ", join(',', $c->label_barcodes(storage => 'SDLT-1-2',
# slots => 6,
# drive => 0)), "\n";