From 9cba3b98d8c43739833413d612f40b5a2b98b92f Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Wed, 11 Apr 2012 17:25:56 +0930 Subject: [PATCH] allow TftpServer.root not to exist if a dyn_file_func is provided --- tftpy/TftpServer.py | 7 +++++-- 1 file 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."