-
Notifications
You must be signed in to change notification settings - Fork 125
Conversation
@@ -122,7 +122,9 @@ def __init__(self, **server_settings): | |||
import_safe[packed_mac] = imported[lease] | |||
self.leases.update(import_safe) | |||
self.logger.info('Loaded leases from {0}'.format(self.save_leases_file)) | |||
except IOError, ValueError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for splitting these up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically I should have made those proper functions but this gets by the Python3 test for exception changes.
HTTP port addition looks good, I'm surprised it wasn't already there to be honest. wrt NBD, IIRC I used the Arch wiki to setup a initrd/kernel that would boot from an arch disk image: https://wiki.archlinux.org/index.php/Diskless_system, but I imagine there is documentation for whatever your distro is. Unfortunately I don't have the time at the moment to test these things to get them merged, so unless @mmattioli is willing and has the time, they might have to wait until June ish when I've graduated, apologies for that. I don't mind if your PRs pile up in the mean time, although I realise that might be a little awkward to manage. I notice you've imported the
Doesn't that mean that standard |
On the IO Open vs Open, json.load changed and the io.open works the same from version to version to make sure it works with 2x and 3x Python. json.load was not in the diff so I could have called that out better. No worries on the time frame. Just proving that it is not that hard to do. Take what you like and toss the rest. I did the proof of concept for Ansible's Python 3 transition a few years ago so sort of my thing. I see there are other options like ports for the other protocols missing as well. I might get to that. Would be useful so that the services could be started in userland for testing as non root for the future and stuffs. |
Makes sense. I've wanted python3 for a while now, but I've failed to complete it a few times. My main issues were with the changes in string handling, which is used a lot for the struct packing/unpacking in some of the binary modules. It didn't help that I didn't read up properly on the changes. Some of the ports can't change, DHCP/TFTP spring to mind, but others should change easily, you're right. |
Anything I should do to move this forward or should I drop this and do separate pull requests? |
pypxe/server.py
Outdated
print >> sys.stderr, '\nWARNING: Not root. Servers will probably fail to bind.\n' | ||
|
||
if os.geteuid() != 0: | ||
sys.exit("You need to have root privileges to run this script.\nPlease try again, this time using 'sudo'. Exiting.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't necessarily need to exit here, if the user is only trying to run services with non privileged ports they should still be allowed to continue, but with a warning.
In fact, more logic might be appreciated, and we only print/exit if any of the ports to be used are <1024 and we are non root
setup.py
Outdated
@@ -5,11 +5,6 @@ | |||
|
|||
deps = [] | |||
|
|||
# Python 3 unsupported |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably only want to remove this when full Python3 support is present, so we don't get bug reports for things we know aren't working yet
I've just added a few inline comments, and then we should be good to merge. |
Could you just squash your commits and then we should be good to go :) |
Ack, adjusted PR to address those. BTW Python 3 works for me but I did only basic testing. I know there is massive room for improvement over time. Looking at squashing via GUI as I am mobile. Does not look like there is an option in the gui.. will be a few min getting that. |
It would be handy if you could make a checklist of things that you've tested and things which are todo, so we can have an overall picture going forward. As mentioned above I think some of the modules such as DHCP will be tricky to port because of the amount of binary data being handled. |
made a mess as I was in a hurry, will sit down and attack this later after some life things |
broke apart the issues into fresh PRs as I made a mess. Don't mix fast mobile Github GUI edits on master with actual work development. :( I can close your anyone can, just leave it open until I get an ack. |
all merged save for the geteuid which I will get a pr for in a few minutes |
#158 catches every thing, closing this. |
Rory, I had to add the HTTP Port for testing and got Python3 working. I need some help testing the NBD stuff but am happy to correct/update for that.
Tell me what you want to do here. If you want to just do that HTTP Port that is cool.
example from setuptools install...
Copying PyPXE-1.7.2-py3.4.egg to /usr/local/lib/python3.4/dist-packages
Adding PyPXE 1.7.2 to easy-install.pth file
Installing pypxe script to /usr/local/bin
Installed /usr/local/lib/python3.4/dist-packages/PyPXE-1.7.2-py3.4.egg
Processing dependencies for PyPXE==1.7.2
Finished processing dependencies for PyPXE==1.7.2