From 50fd0cef8ae76c920fc2f09af5cc4e8dc149e9e7 Mon Sep 17 00:00:00 2001 From: Adam Stokes Date: Sun, 14 Apr 2013 12:28:36 -0400 Subject: Fix imports in correct files sos/archive.py: - Archive uses selinux module but wasn't included sos/policies/__init__: - sys.exit called without sys import Signed-off-by: Adam Stokes --- sos/archive.py | 5 +++++ sos/policies/__init__.py | 1 + sos/utilities.py | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sos/archive.py b/sos/archive.py index f837c600..f1b0b057 100644 --- a/sos/archive.py +++ b/sos/archive.py @@ -27,6 +27,11 @@ import re # required for compression callout (FIXME: move to policy?) from subprocess import Popen, PIPE, STDOUT +try: + import selinux +except ImportError: + pass + try: from cStringIO import StringIO except ImportError: diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py index 8148c894..522aaff5 100644 --- a/sos/policies/__init__.py +++ b/sos/policies/__init__.py @@ -5,6 +5,7 @@ import re import platform import time import fnmatch +import sys from os import environ from sos.utilities import ImporterHelper, \ diff --git a/sos/utilities.py b/sos/utilities.py index 64d0ce62..fcc78c54 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -35,10 +35,6 @@ import tarfile import hashlib import logging import fnmatch -try: - import selinux -except ImportError: - pass from contextlib import closing try: -- cgit