Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ip network" in /etc/warewulf/provision.conf is trailing space sensitive #313

Open
bernstei opened this issue Aug 25, 2022 · 2 comments
Open

Comments

@bernstei
Copy link

I accidentally set
ip address = 10.1.0.0  
with a trailing space in /etc/warewulf/provision.conf. I noticed that there was a message in /etc/dhcp/dhcpd.conf about not having an entry for the node because it was not in the boot network. When I looked in line 288 (in my version, from OpenHPC 2.5) of /usr/share/perl5/vendor_perl/Warewulf/Provision/Dhcp/Isc.pm, I discovered that the test for matching networks if ($node_testnetwork ne $network) { is thrown off by the trailing space in $network. I guess this should be fixed in the code that extract the network value from the config file, but I have no idea where that is.

@jmstover
Copy link
Contributor

jmstover commented Aug 25, 2022

The same function used to read that value out, is also used to read out the value of passwords... which could have an ending space. Or an ending space could be needed...

Around line 154 in ISC.pm should be where $network is set and right after you should be able to cut out any white space with:

$network =~ s/^\s+|\s+$//g

But Warewulf::Config->get() function is going to pull the value as is from the config file.

Edit: The whitespace thing is something that I initially ran into a few times, and since I've just gotten used to making sure there isn't any trailing spaces instead of putting in special conditions. And then maybe missing all the places that the change is needed.

@bernstei
Copy link
Author

Good point about the general parsing code, so I agree that if anything it belongs in Isc.pm, but it was very surprising to me. At least a slightly more verbose error message, which printed both sides of the test, would have helped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants