]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests: Remove unnecessary use of global in Log::log()
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Sat, 10 Jan 2026 06:42:09 +0000 (12:12 +0530)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 10 Mar 2026 16:38:04 +0000 (22:08 +0530)
The global statement is only required when assigning to a global
variable, not when simply reading its value. In Log::log(), the
global log_level, global log_file and global log_fd declarations
are unnecessary because these variables are only read. Remove both
declarations from Log::log().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/ftests/log.py

index b1763c17ae001caa9857acd233878f03ba82d041..026e4d1745bc0c8032bf521a48a85aa6659731e1 100644 (file)
@@ -18,8 +18,6 @@ class Log(object):
 
     @staticmethod
     def log(msg, msg_level=consts.DEFAULT_LOG_LEVEL):
-        global log_level, log_file, log_fd
-
         if log_level >= msg_level:
             if log_fd is None:
                 Log.open_logfd(log_file)