On Thu, Mar 16, 2017 at 11:46:50 -0400, Jean-Louis Martineau wrote:
> Thanks for reporting the issue.
> I committed the attached patch.
[...] 
> diff --git a/perl/Amanda/Tapelist.swg b/perl/Amanda/Tapelist.swg
> index 99f1164..e846eb0 100644
> --- a/perl/Amanda/Tapelist.swg
> +++ b/perl/Amanda/Tapelist.swg
> @@ -309,7 +309,12 @@ sub _read_tapelist {
>      $self->{'tle_hash_label'} = undef;
>      $self->{'tle_hash_barcode'} = undef;
>      my $linenum = 0;
> -    open(my $fh, "<", $self->{'filename'}) or return undef;
> +    my $fh;
> +    if (!open($fh, "<", $self->{'filename'})) {
> +     $self->{'tles'} = [];
> +     return undef;
> +    }
> +
>      while (my $line = <$fh>) {
>       $linenum++;
>       my ($datestamp, $label, $reuse, $barcode, $meta, $blocksize, $pool, 
> $storage, $config, $comment)

I manually applied this patch to the system Tapelist.pm file, and can
confirm a newly-created tapelist file is populated correctly:

====
# rm tapelist
# su backup -c "amlabel TestBackup TESTBACKUP-01 slot 1"
Reading label...
Found an empty tape.
Writing label 'TESTBACKUP-01'...
Checking label...
Success!
# cat tapelist
0 TESTBACKUP-01 reuse BLOCKSIZE:32 POOL:TestBackup STORAGE:TestBackup 
CONFIG:TestBackup
====

Thanks!

                                                        Nathan

----------------------------------------------------------------------------
Nathan Stratton Treadway  -  natha...@ontko.com  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239

Reply via email to