alces-software / metalware

Tools and conventions for improving bare metal machine management
Other
2 stars 0 forks source link

Weird Control Characters in PXE Config File Names #437

Closed ColonelPanicks closed 6 years ago

ColonelPanicks commented 6 years ago

Soooooo when the metal build command runs for a node it outputs the hexadecimal IP of the node but seems to be appending a strange character:

# ls output
[root@controller [testcluster] pxelinux.cfg]# ls
0A0A0101?  0A0A0102?  0A0A1001?  default

# Different output on tab complete
[root@controller [testcluster] pxelinux.cfg]# metal render /tmp/test node001 > /var/lib/tftpboot/pxelinux.cfg/
0A0A0101^J  0A0A0102^J  0A0A1001^J  default

Any idea what's going on here?? I can't read the files due to the strange control characters and PXE booting is pretty integral to metalware!

ColonelPanicks commented 6 years ago

This seems to be as a result of switching from render_to_file to render:

All that's missing is a chomp in the render method.

bobwhitelock commented 6 years ago

Are you fixing this @ColonelPanicks or does it need more investigation?

WilliamMcCumstie commented 6 years ago

The bug is being caused by the SystemCommand class not chomping the new line characters off. This means node.hexadecimal_ip returns the IP with the newline.

This was previously not an issue as the Templater was removing it in its file writing method, however this has since been removed.

An easy fix would be to add the chomp back when writing the file. However the more logical fix would be remove the endline from the hexip in the first place.

Either way this isn't a pressing issue and can be fixed before the next release. The bug does not appear in the previous releases.