Re: some fixes to Vault.pm (Amanda 3.4)

Jean-Louis Martineau <[email protected]> Mon, 25 Sep 2017 08:46:43 -0400
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
Nathan,

The attached patch fix the quit issue?

Jean-Louis

On 22/09/17 10:03 PM, Nathan Stratton Treadway wrote:
> On Fri, Sep 22, 2017 at 09:04:05 -0400, Jean-Louis Martineau wrote:
> > Nathan,
> >
> > Thanks for both patch.
> > I committed the attached patch, I made some more fix, can you try them?
> >
>
> I didn't rebuild everything from scratch, but I believe I applied the
> patches correctly to amvault and Vault.pm 
> <http://Vault.pm>, and 
> now when I run something
> like
> su backup -c "amvault TestBackup --dest-storage TestOffsite --dry-run 
> --src-labelstr TESTBACKUP \* 2>&1"
> or
> su backup -c "amvault TestBackup --dest-storage TestOffsite --dry-run 
> --src-timestamp latest 2>&1"
>
> , the last line of the output is:
>
> amvault: Can't call method "quit" on an undefined value at 
> /usr/lib/x86_64-linux-gnu/amanda/perl/Amanda/Vault.pm line 899.
>
> Line 899 is the "$self->{'dst'}{'scan'}->quit();" line within
> quit_scribe_finished {} .
>
>
> Nathan
>
>
> ----------------------------------------------------------------------------
> Nathan Stratton Treadway - [email protected] - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> <http://www.ontko.com/>
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
> <http://www.ontko.com/~nathanst/gpg_key.txt> ID: 
> 1023D/ECFB6239
> Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
This message is the property of CARBONITE, INC. and may contain confidential or privileged information.
If this message has been delivered to you by mistake, then do not copy or deliver this message to anyone.  Instead, destroy it and notify me by reply e-mail
Vault-quit.diff (text/x-patch, 412 B)
diff --git a/perl/Amanda/Vault.pm b/perl/Amanda/Vault.pm
index 05166ce..562dd3c 100644
--- a/perl/Amanda/Vault.pm
+++ b/perl/Amanda/Vault.pm
@@ -896,7 +896,7 @@ sub quit {
 
     step quit_scribe_finished => sub {
 	my ($err) = @_;
-	$self->{'dst'}{'scan'}->quit();
+	$self->{'dst'}{'scan'}->quit() if defined $self->{'dst'}{'scan'};
 	if ($err) {
 	    $self->user_msg($err);
 	    debug("scribe error: $err");