* Dustin J. Mitchell <[email protected]> [20100616 14:48]:
> First, I'm excited you're using the modules, and thanks for the feedback!

I have a few more queries about this, like how to get the changer
inventory using the inventory method as described in the Changer.pm POD

$chg = Amanda::Changer->new($my_changer);
$chg->inventory(inventory_cb => $inventory_cb);

I'm not quite sure on how to define the callback. I went through the
amtape source but this OO stuff is way over my head. More on this on
an another thread!

> On Wed, Jun 16, 2010 at 11:50 AM, Jean-Francois Malouin
> <[email protected]> wrote:
> > Using Amanda::Config.pm as an example I tried:
> >
> > config_init($CONFIG_INIT_EXPLICIT_NAME, "Config_Name");
> > $ss = lookup_changer_config("av48");
> > $slot_range = changer_config_getconf($ss, "use-slots");
> >
> > but that obviously fails. Notice my lack of perl-fu :)
> 
> I think the only missing aspect in the above is that instead of
> "use-slots", you'll need to use $CHANGER_CONFIG_USE_SLOTS, which is
> available with
>   use Amanda::Config qw( :constants );

Are you sure about that? 
I don't see any $CHANGER_CONFIG_USE_SLOTS in 3.1.0...

In the mean time I resorted to slurp all the changer properties with

$tpc_prop = changer_config_getconf($ss, $CHANGER_CONFIG_PROPERTY);

and parse the hash until I hit "use-slots => values"
Not pretty but I'm in a hurry to update my scripts to work
again with amanda 3.1.0

> I didn't document these constants in the POD because there's no
> automatic way to make sure that conffile.c/h and the POD will stay in
> sync, and we're fabulously bad at remembering to update the same thing
> in two places.  They're all available and pretty readable in
> common-src/conffile.h.
> 
> It occurs to me that the necessary string tables exist to also make
> things work the way you've expected them to work.  Unless there's s
> SWIG expert in the crowd (where's Dave Beazley when you need him?) who
> wants to take a swing at that, I'll see what I can cook up.
> 
> > There seems to be a few typos in the pod for Config.pm btw.
> 
> Patches and/or specific pointers would be welcome!
>   http://wiki.zmanda.com/index.php/Fork_Amanda_on_Github

Will do as I grok the new API...

Thanks for the great work.
jf

> 
> Dustin
> 
> -- 
> Open Source Storage Engineer
> http://www.zmanda.com

Reply via email to