diff --git a/utils/apparmor/common.py b/utils/apparmor/common.py index 3152a986e..73d1c6fe3 100644 --- a/utils/apparmor/common.py +++ b/utils/apparmor/common.py @@ -10,7 +10,6 @@ # ------------------------------------------------------------------ import collections -import glob import logging import os import re @@ -169,14 +168,6 @@ def valid_path(path): return True -def get_directory_contents(path): - """Find contents of the given directory""" - if not valid_path(path): - return None - - return sorted(glob.glob(path + "/*")) - - def is_skippable_file(path): """Returns True if filename matches something to be skipped (rpm or dpkg backup files, hidden files etc.) The list of skippable files needs to be synced with apparmor initscript and libapparmor _aa_is_blacklisted() diff --git a/utils/apparmor/easyprof.py b/utils/apparmor/easyprof.py index 1a4293085..18c056f45 100644 --- a/utils/apparmor/easyprof.py +++ b/utils/apparmor/easyprof.py @@ -200,12 +200,7 @@ def get_directory_contents(path): if not valid_path(path): return None - files = [] - for f in glob.glob(path + "/*"): - files.append(f) - - files.sort() - return files + return sorted(glob.glob(path + "/*")) def verify_policy(policy, exe, base=None, include=None):