Re: Streamlined application/script development [Re: coding an Application in perl]

Jean-Louis Martineau <[email protected]> Fri, 1 Sep 2017 10:49:00 -0400
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
On 01/09/17 10:01 AM, Chapman Flack wrote:
> On 09/01/2017 09:41 AM, Jean-Louis Martineau wrote:
>
>> 'directory' is not a good name, so if you get a better name, we can use it.
> Hmm, destination? workspace? ...?
destination is good for restore but it doesn't sound correct for a backup.

>   Does that mean you would consider
> changing it for all apps old and new in order to have it consistent?
maybe, if we find a better name

directory is a mandatory option for the restore because amfetchdump have 
a --directory option when doing an extraction.

>
> I was trying to avoid any change to existing behavior (but it's true,
> I didn't feel right using 'directory' for things that weren't
> directories).
>
>> The Abstract class should not check if 'directory' is a directory.
> I think it should chdir() there, if it is a directory, since that would
> otherwise be duplicated code in all applications. So I guess it should
> still check, but if it is not an actual directory, should simply accept
> it quietly? Then the application subclass will just have to check the
> option and know what to do with it anyway.
I think it should be done in a different method, so that all 
applications that require 'directory' to be a directory can call that 
method which fail if it is not a directory.

>
>> I'm not sure that all the declare_*_options are required as everything
>> 'backup' need must be accepted for all commands.
> OK, I wasn't sure about that. There might still be extra 'restore'
> properties, right? Because you can set those in an amrecover session.
Some are used only for restore, but a user might want to put it in the 
disklist because it know it will always use the same value for that 
property?
If the property is in the disklist then all commands must accept it,the 
property will be put in the amanda header and used at restore time.
But there is probably some restore property we do not want to be set in 
the disklist, to force the user to set it at restore time, so 
declare_restore_options is good.

Jean-Louis
>
> -Chap
>
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