Subject: | Bug in Filer.pm |
Date: | Wed, 18 Nov 2009 10:20:56 -0800 |
To: | <bug-NetApp [...] rt.cpan.org> |
From: | Christian Huebner <chuebner [...] ffn.com> |
Hi Phillip,
The last couple of days I have been working with your NetApp modules
(Version 1.1.2 (Module Version 332.0.0) with Perl 5.8.8 on CentOS 5.2)
and I would like to thank you for providing it.
Today I came across a what I believe to be a bug in the
Aggregate::get_volume method:
I call Aggregate::create_volume with the parameters
name => "DevEnv1",
size => "5000m",
space => "volume";
With this call an error is produced on the last line of this method:
Error running 'vol status name -v' via ssh on netapp122:
vol status: No volume named 'name' exists.
at /usr/lib/perl5/site_perl/5.8.8/NetApp/Aggregate.pm line 220
This is what line 220 looks like:
return $self->get_filer->get_volume( name => $args{name} );
$args{name}
Checking into Filer::get_volume() we see three arguments handed over:
The handle of the filer, the string 'name' and the name itself.
In get_volume there are only two shift statements ($self and $name).
This means that $name always resolves to the string 'name', not the
actual volume name we need.
I see two ways to resolve this:
- Hand over the the name as a scalar:
return $self->get_filer->get_volume( $args{name} );
thus reducing the number of arguments to 2 and making the second
shift retrieve the name
- Take apart the handed-over object:
my (%args) = validate( @_, {
name => { type => SCALAR },
});
And then using the args hash to reference the name:
$self->_run_command(
command => [qw( vol status ), $args{name}, '-v' ],
);
In other functions using get_filer->get_volume I see a plain string used
so the first option would be easier to implement.
For now I am using a patched version of NetApp::Aggregate according to
the first option, but I would prefer a new release to my homemade patch.
Please feel free to contact me with questions or comments.
Thanks
Christian
--
Christian Huebner
Sr. Data Architect
FriendFinder Networks
chuebner@ffn.com
408-745-5539
The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of the person(s) named above. If you are not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.