diff --git a/lib/backend.py b/lib/backend.py index 10b08a277e5e39aa59d8706c058151b696999247..18cf4c40e48f782d56270749cd980cc195211a9d 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -2678,7 +2678,7 @@ def PowercycleNode(hypervisor_type): # ensure the child is running on ram try: utils.Mlockall() - except Exception: + except Exception: # pylint: disable-msg=W0703 pass time.sleep(5) hyper.PowercycleNode() diff --git a/lib/utils.py b/lib/utils.py index cdb02bf7744ad76d0bcda6c12b53918689ec819a..c1d5c6fbe876aad9c916b6731d05c0e7d8e0d851 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -1769,9 +1769,11 @@ def Mlockall(): # By declaring this variable as a pointer to an integer we can then access # its value correctly, should the mlockall call fail, in order to see what # the actual error code was. + # pylint: disable-msg=W0212 libc.__errno_location.restype = ctypes.POINTER(ctypes.c_int) if libc.mlockall(_MCL_CURRENT | _MCL_FUTURE): + # pylint: disable-msg=W0212 logging.error("Cannot set memory lock: %s", os.strerror(libc.__errno_location().contents.value)) return @@ -2084,7 +2086,7 @@ class LogFileHandler(logging.FileHandler): logging.FileHandler.__init__(self, filename, mode, encoding) self.console = open(constants.DEV_CONSOLE, "a") - def handleError(self, record): + def handleError(self, record): # pylint: disable-msg=C0103 """Handle errors which occur during an emit() call. Try to handle errors with FileHandler method, if it fails write to @@ -2093,10 +2095,10 @@ class LogFileHandler(logging.FileHandler): """ try: logging.FileHandler.handleError(self, record) - except Exception: + except Exception: # pylint: disable-msg=W0703 try: self.console.write("Cannot log message:\n%s\n" % self.format(record)) - except Exception: + except Exception: # pylint: disable-msg=W0703 # Log handler tried everything it could, now just give up pass