2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-09-02 15:25:27 +00:00

Fix more pyflakes issues that cause make check to fail

This commit is contained in:
Steve Beattie
2014-02-13 10:01:03 -08:00
parent f652178a02
commit 81b3db3dbf
6 changed files with 5 additions and 15 deletions

View File

@@ -13,7 +13,6 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# No old version logs, only 2.6 + supported # No old version logs, only 2.6 + supported
from __future__ import with_statement from __future__ import with_statement
import gettext
import inspect import inspect
import os import os
import re import re
@@ -28,12 +27,10 @@ import tempfile
import apparmor.config import apparmor.config
import apparmor.logparser import apparmor.logparser
import apparmor.severity import apparmor.severity
import LibAppArmor
from copy import deepcopy from copy import deepcopy
from apparmor.common import (AppArmorException, error, debug, msg, cmd, from apparmor.common import (AppArmorException, open_file_read, valid_path, hasher,
open_file_read, valid_path, hasher,
open_file_write, convert_regexp, DebugLogger) open_file_write, convert_regexp, DebugLogger)
import apparmor.ui as aaui import apparmor.ui as aaui
@@ -313,7 +310,7 @@ def head(file):
def get_output(params): def get_output(params):
"""Returns the return code output by running the program with the args given in the list""" """Returns the return code output by running the program with the args given in the list"""
program = params[0] program = params[0]
args = params[1:] # args = params[1:]
ret = -1 ret = -1
output = [] output = []
# program is executable # program is executable
@@ -454,7 +451,7 @@ def get_profile(prof_name):
profile_data = None profile_data = None
distro = cfg['repository']['distro'] distro = cfg['repository']['distro']
repo_url = cfg['repository']['url'] repo_url = cfg['repository']['url']
local_profiles = [] # local_profiles = []
profile_hash = hasher() profile_hash = hasher()
if repo_is_enabled(): if repo_is_enabled():
aaui.UI_BusyStart(_('Connecting to repository...')) aaui.UI_BusyStart(_('Connecting to repository...'))

View File

@@ -11,16 +11,12 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
import gettext
import os import os
import re import re
import sys import sys
import time import time
import LibAppArmor import LibAppArmor
from apparmor.common import (AppArmorException, error, debug, from apparmor.common import AppArmorException, open_file_read, DebugLogger
open_file_read, valid_path, hasher,
open_file_write, convert_regexp,
DebugLogger)
from apparmor.aamode import validate_log_mode, log_str_to_mode, hide_log_mode, AA_MAY_EXEC from apparmor.aamode import validate_log_mode, log_str_to_mode, hide_log_mode, AA_MAY_EXEC

View File

@@ -64,7 +64,7 @@ class Severity(object):
try: try:
resource, severity = line.split() resource, severity = line.split()
severity = int(severity) severity = int(severity)
except ValueError as e: except ValueError:
error_message = 'No severity value present in file: %s\n\t[Line %s]: %s' % (dbname, lineno, line) error_message = 'No severity value present in file: %s\n\t[Line %s]: %s' % (dbname, lineno, line)
#error(error_message) #error(error_message)
raise AppArmorException(error_message) # from None raise AppArmorException(error_message) # from None

View File

@@ -11,7 +11,6 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
import gettext
import os import os
import sys import sys

View File

@@ -11,7 +11,6 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
import gettext
import sys import sys
import re import re
from apparmor.yasti import yastLog, SendDataToYast, GetDataFromYast from apparmor.yasti import yastLog, SendDataToYast, GetDataFromYast

View File

@@ -13,7 +13,6 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
import re import re
#import ycp #import ycp
import os
import sys import sys
from apparmor.common import error, DebugLogger from apparmor.common import error, DebugLogger