improve the check on dyn_file_func of TftpServer
This commit is contained in:
parent
9cba3b98d8
commit
e8039dd715
1 changed files with 3 additions and 3 deletions
|
@ -29,9 +29,9 @@ class TftpServer(TftpSession):
|
||||||
# ip:tid for the remote end.
|
# ip:tid for the remote end.
|
||||||
self.sessions = {}
|
self.sessions = {}
|
||||||
|
|
||||||
if callable(self.dyn_file_func):
|
if self.dyn_file_func:
|
||||||
# don't check the tftproot
|
if not callable(self.dyn_file_func):
|
||||||
pass
|
raise TftpException, "A dyn_file_func supplied, but it is not callable."
|
||||||
elif os.path.exists(self.root):
|
elif os.path.exists(self.root):
|
||||||
log.debug("tftproot %s does exist" % self.root)
|
log.debug("tftproot %s does exist" % self.root)
|
||||||
if not os.path.isdir(self.root):
|
if not os.path.isdir(self.root):
|
||||||
|
|
Reference in a new issue