config ignored for dhcp service
bryfry opened this issue · 5 comments
These arguments need their order reversed. In the current order, no matter what you put in the config the USE_DHCP will be false.
Additionally, the documented defaults do not match the code:
Documented / Actual
This may be why the config file gets ignored. As it currently stands you have to explicitly call --dhcp
. I'd prefer to use the config.
It is intentional to explicitly call --dhcp
; there might already be an existing DHCP server on the network sending clients to PyPXE.
Good catch on the documentation discrepancy, thank you.
If using a configuration file, the arguments are overwritten when the config is loaded. This was addressed in #84.
If I run pypxe-server.py
with the provided example_cfg.json
file I should expect DHCP to startup since "USE_DHCP" : true,. Actual result is below:
$ sudo python pypxe-server.py --debug all --config example_cfg.json
2015-10-22 22:15:17,914 [INFO] PyPXE Starting TFTP server...
2015-10-22 22:15:17,914 [DEBUG] PyPXE.TFTP NOTICE: TFTP server started in debug mode. TFTP server is using the following:
2015-10-22 22:15:17,914 [DEBUG] PyPXE.TFTP Server IP: 0.0.0.0
2015-10-22 22:15:17,914 [DEBUG] PyPXE.TFTP Server Port: 69
2015-10-22 22:15:17,915 [DEBUG] PyPXE.TFTP Network Boot Directory: .
2015-10-22 22:15:17,915 [INFO] PyPXE PyPXE successfully initialized and running!
Given that the defaults are DHCP disabled I think the --no-dhcp should be removed. This is also a fix for the issue of the config not being recognized because of the argument parsing order.
See pr #118 or #119 depending on which branch this belongs in.
- Looks like you opened 2 PRs, please only submit 1
- You need to open a PR against the
development
branch so we can test before merging tomaster
- Please make sure that in your commit message you reference a fix to the issue number (i.e.
fixes #116
)
Please take care of the aforementioned and we will review. Thanks.
Closed the PR on master
Fixed in #119