diff options
author | Rafael Gago <rgc@hms.se> | 2019-09-17 09:15:50 +0200 |
---|---|---|
committer | Rafael Gago <rgc@hms.se> | 2019-09-17 09:34:42 +0200 |
commit | d0d2ca0eb9b74d40654f67375d5a176f77d72972 (patch) | |
tree | 0e11b88ecec9e6484ebd47ff22afc0f6be93add2 | |
parent | af2f2fe89a3bf45748b78703820efb0986a8207a (diff) | |
download | tftpy-d0d2ca0eb9b74d40654f67375d5a176f77d72972.tar.gz |
TftpServer: lower log level for clean shutdown msgs
Before this commit all clean shutdown sequences (without active
sessions) were issuing warnings on the logs. Closing the server
without active sessions is normal behavior, so it should not
generate error messages.
This commit fixes this.
-rw-r--r-- | tftpy/TftpServer.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tftpy/TftpServer.py b/tftpy/TftpServer.py index 95ca70e..09c0358 100644 --- a/tftpy/TftpServer.py +++ b/tftpy/TftpServer.py @@ -103,17 +103,18 @@ class TftpServer(TftpSession): log.debug("shutdown_immediately is %s" % self.shutdown_immediately) log.debug("shutdown_gracefully is %s" % self.shutdown_gracefully) if self.shutdown_immediately: - log.warning("Shutting down now. Session count: %d" % - len(self.sessions)) + log.info("Shutting down inmmediately") self.sock.close() for key in self.sessions: + log.warning("Forcefully closed session with %s" % + self.sessions[key].host) self.sessions[key].end() self.sessions = [] break elif self.shutdown_gracefully: if not self.sessions: - log.warning("In graceful shutdown mode and all " + log.info("In graceful shutdown mode and all " "sessions complete.") self.sock.close() break |