summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Farrell <micolous+git@gmail.com>2012-04-12 10:34:35 +0930
committerMichael Farrell <micolous+git@gmail.com>2012-04-12 10:34:35 +0930
commite8039dd715242d6830ff1005085fec5bb89b300c (patch)
tree7b0d8fc8b4f24584b374b4a1a3c0590a5ecaf97c
parent9cba3b98d8c43739833413d612f40b5a2b98b92f (diff)
downloadtftpy-e8039dd715242d6830ff1005085fec5bb89b300c.tar.gz
improve the check on dyn_file_func of TftpServer
-rw-r--r--tftpy/TftpServer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tftpy/TftpServer.py b/tftpy/TftpServer.py
index 02b20dc..0f15fc0 100644
--- a/tftpy/TftpServer.py
+++ b/tftpy/TftpServer.py
@@ -29,9 +29,9 @@ class TftpServer(TftpSession):
# ip:tid for the remote end.
self.sessions = {}
- if callable(self.dyn_file_func):
- # don't check the tftproot
- pass
+ if self.dyn_file_func:
+ if not callable(self.dyn_file_func):
+ raise TftpException, "A dyn_file_func supplied, but it is not callable."
elif os.path.exists(self.root):
log.debug("tftproot %s does exist" % self.root)
if not os.path.isdir(self.root):