Subject: | Problem in generate when in a host section a "filename "pxelinux.0";" entry exists |
If you try to parse an entry like:
host nacarhost001 {
hardware ethernet 00:1e:c9:50:4f:98;
fixed-address 172.30.2.1;
next-server 172.30.0.65;
filename "pxelinux.0";
option host-name "nacarhost001";
}
If you parse this entry as
my $d =
Net::ISC::DHCPd::Config->new(file=>'/home/nito/tmp/dhcpd.nacarhost.conf');
$d->parse;
$d->generate();
you get an error like this.
Can't locate object method "name" via package
"Net::ISC::DHCPd::Config::Filename" at
/usr/local/share/perl/5.10.0/Net/ISC/DHCPd/Config/Filename.pm line 58,
<$FH> line 16.
I have been looking into the code and I think that this change would fix it.
--- /usr/local/share/perl/5.10.0/Net/ISC/DHCPd/Config/Filename.pm.orig
2009-09-14 18:48:48.000000000 +0200
+++ /usr/local/share/perl/5.10.0/Net/ISC/DHCPd/Config/Filename.pm
2009-09-14 18:49:08.000000000 +0200
@@ -55,7 +55,7 @@
=cut
sub generate {
- return sprintf q(filename %s;), shift->name;
+ return sprintf q(filename %s;), shift->file;
}
=head1 AUTHOR
This would help me to automatically provision the module from CPAN.