summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Farrell <micolous+git@gmail.com>2012-04-11 17:25:56 +0930
committerMichael Farrell <micolous+git@gmail.com>2012-04-11 17:25:56 +0930
commit9cba3b98d8c43739833413d612f40b5a2b98b92f (patch)
tree27a6470a63e3ee7f2a026e298049081f31fc78a6
parent2b879b34d6cbd8539c785eec8ef415f60b928f86 (diff)
downloadtftpy-9cba3b98d8c43739833413d612f40b5a2b98b92f.tar.gz
allow TftpServer.root not to exist if a dyn_file_func is provided
-rw-r--r--tftpy/TftpServer.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tftpy/TftpServer.py b/tftpy/TftpServer.py
index 364227c..02b20dc 100644
--- a/tftpy/TftpServer.py
+++ b/tftpy/TftpServer.py
@@ -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."