allow TftpServer.root not to exist if a dyn_file_func is provided

master
Michael Farrell 2012-04-11 17:25:56 +09:30
parent 2b879b34d6
commit 9cba3b98d8
1 changed files with 5 additions and 2 deletions

View File

@ -28,8 +28,11 @@ class TftpServer(TftpSession):
# A dict of sessions, where each session is keyed by a string like
# ip:tid for the remote end.
self.sessions = {}
if os.path.exists(self.root):
if callable(self.dyn_file_func):
# don't check the tftproot
pass
elif os.path.exists(self.root):
log.debug("tftproot %s does exist" % self.root)
if not os.path.isdir(self.root):
raise TftpException, "The tftproot must be a directory."