aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Quigley <bryan.quigley@canonical.com>2020-04-10 10:09:27 -0700
committerJake Hunsaker <jhunsake@redhat.com>2020-04-14 13:47:14 -0400
commit89dcfaa6de0310c54a988d1eb5a4a5dc10e3fef4 (patch)
treeb645ebf0d606b690e74a10ffba23267d2fafe993
parent33bcb9a5de0d544abb482e06fc363e57507924b2 (diff)
downloadsos-89dcfaa6de0310c54a988d1eb5a4a5dc10e3fef4.tar.gz
[global] fix some flake8 issues
Mostly unused import or missing variables. Including 1 mistyped variable by me. Resolves: #2011 Signed-off-by: Bryan Quigley <bryan.quigley@canonical.com> Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/__init__.py2
-rw-r--r--sos/options.py2
-rw-r--r--sos/report/__init__.py5
-rw-r--r--sos/report/plugins/gluster.py6
4 files changed, 6 insertions, 9 deletions
diff --git a/sos/__init__.py b/sos/__init__.py
index 05631c59..5d333f7a 100644
--- a/sos/__init__.py
+++ b/sos/__init__.py
@@ -16,9 +16,7 @@ gettext to internationalize messages.
"""
__version__ = "3.9"
-import logging
import sys
-import tempfile
from argparse import ArgumentParser
from sos.options import SosListOption
diff --git a/sos/options.py b/sos/options.py
index aeabe1ef..923b7613 100644
--- a/sos/options.py
+++ b/sos/options.py
@@ -70,7 +70,7 @@ class SoSOptions():
vals = [",".join(v) if _is_seq(v) else v for v in vals]
else:
# Only quote strings if quote=False
- vals = ["'%s'" % v if isinstance(val, str) else v for v in vals]
+ vals = ["'%s'" % v if isinstance(v, str) else v for v in vals]
return (args % tuple(vals)).strip(sep) + suffix
diff --git a/sos/report/__init__.py b/sos/report/__init__.py
index 63c226eb..3772ad68 100644
--- a/sos/report/__init__.py
+++ b/sos/report/__init__.py
@@ -15,11 +15,10 @@ import errno
import logging
from datetime import datetime
-from argparse import ArgumentParser, Action
+import glob
import sos.report.plugins
-from sos.utilities import ImporterHelper, SoSTimeoutError, TempFileUtil
+from sos.utilities import ImporterHelper, SoSTimeoutError
from shutil import rmtree
-import tempfile
import hashlib
from concurrent.futures import ThreadPoolExecutor, TimeoutError
import pdb
diff --git a/sos/report/plugins/gluster.py b/sos/report/plugins/gluster.py
index a1d8f977..680b642a 100644
--- a/sos/report/plugins/gluster.py
+++ b/sos/report/plugins/gluster.py
@@ -35,9 +35,9 @@ class Gluster(Plugin, RedHatPlugin):
statedumps_present = statedumps_present+1
ret = -1
while ret == -1:
- last_line = file(
- name_dir + '/' + statedump_file, "r").readlines()[-1]
- ret = string.count(last_line, 'DUMP_END_TIME')
+ with open(name_dir + '/' + statedump_file, 'r') as sfile:
+ last_line = sfile.readlines()[-1]
+ ret = string.count(last_line, 'DUMP_END_TIME')
def postproc(self):
if not os.path.exists(self.statedump_dir):