From 69cbb7f3e298b1ab8e1c0c63fbe7b06719dbf9a0 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Tue, 17 Feb 2015 15:53:18 +0000 Subject: [global] fix code style for pep8 warning W503 Recent versions of the pep8 style checker add checks for: W503 line break before binary operator Numerous sos modules trigger this warning as they follow the C convention of always placing the operator at the beginning of the continuation line. Fix these occurrences (and the Travis CI build for master). Signed-off-by: Bryn M. Reeves --- sos/plugins/__init__.py | 2 +- sos/plugins/abrt.py | 2 +- sos/plugins/cluster.py | 4 ++-- sos/policies/redhat.py | 4 ++-- sos/sosreport.py | 4 ++-- sos/utilities.py | 3 +-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 4ddd185d..2a944ed4 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -611,7 +611,7 @@ class Plugin(object): (prog, suggest_filename, root_symlink, timeout, runat, stderr ) = progs[0] self._log_debug("unpacked command tuple: " - + "('%s', '%s', '%s', %s, '%s', %s)" % progs[0]) + "('%s', '%s', '%s', %s, '%s', %s)" % progs[0]) self._log_info("collecting output of '%s'" % prog) self.get_cmd_output_now(prog, suggest_filename=suggest_filename, root_symlink=root_symlink, diff --git a/sos/plugins/abrt.py b/sos/plugins/abrt.py index a021051d..c3aa2d8e 100644 --- a/sos/plugins/abrt.py +++ b/sos/plugins/abrt.py @@ -32,7 +32,7 @@ class Abrt(Plugin, RedHatPlugin): def do_backtraces(self): result = self.call_ext_prog('sqlite3 ' - + '/var/spool/abrt/abrt-db \'select UUID ' + '/var/spool/abrt/abrt-db \'select UUID ' 'from abrt_v4\'') try: for uuid in result['output'].split(): diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py index ecfaa7b6..9b5eb227 100644 --- a/sos/plugins/cluster.py +++ b/sos/plugins/cluster.py @@ -92,8 +92,8 @@ class Cluster(Plugin, RedHatPlugin): # crm_report needs to be given a --from "YYYY-MM-DD HH:MM:SS" start # time in order to collect data. - crm_from = (datetime.today() - - timedelta(hours=72)).strftime("%Y-%m-%d %H:%m:%S") + crm_from = (datetime.today() - + timedelta(hours=72)).strftime("%Y-%m-%d %H:%m:%S") if self.get_option('crm_from') is not False: if re.match(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}', str(self.get_option('crm_from'))): diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py index 38510d93..b8dd0c49 100644 --- a/sos/policies/redhat.py +++ b/sos/policies/redhat.py @@ -133,8 +133,8 @@ No changes will be made to system configuration. def check(self): """This method checks to see if we are running on RHEL. It returns True or False.""" - return (os.path.isfile('/etc/redhat-release') - and not os.path.isfile('/etc/fedora-release')) + return (os.path.isfile('/etc/redhat-release') and not + os.path.isfile('/etc/fedora-release')) def dist_version(self): try: diff --git a/sos/sosreport.py b/sos/sosreport.py index 5711ab69..f73f13ef 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -260,7 +260,7 @@ class SoSOptions(object): def _check_options_initialized(self): if self._options is not None: raise ValueError("SoSOptions object already initialized " - + "from command line") + "from command line") @property def list_plugins(self): @@ -661,7 +661,7 @@ class SoSReport(object): or not os.access(self.tmpdir, os.W_OK): # write directly to stderr as logging is not initialised yet sys.stderr.write("temporary directory %s " % self.tmpdir - + "does not exist or is not writable\n") + "does not exist or is not writable\n") self._exit(1) self.tempfile_util = TempFileUtil(self.tmpdir) self._set_directories() diff --git a/sos/utilities.py b/sos/utilities.py index db340f8c..b1ec7720 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -209,8 +209,7 @@ class ImporterHelper(object): def _get_plugins_from_list(self, list_): plugins = [self._plugin_name(plugin) for plugin in list_ - if "__init__" not in plugin - and plugin.endswith(".py")] + if "__init__" not in plugin and plugin.endswith(".py")] plugins.sort() return plugins -- cgit