Hello Sandro Bonazzola, I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/27531 to review the following change. Change subject: nit: pep8 fixes ...................................................................... nit: pep8 fixes Change-Id: I1e1b39482b6c94150a69bada02cd80d95505a3ae Signed-off-by: Sandro Bonazzola <sbona...@redhat.com> --- M src/__main__.py M src/sos/plugins/engine.py M src/sos/plugins/ovirt_engine_dwh.py M src/sos/plugins/ovirt_engine_reports.py 4 files changed, 39 insertions(+), 39 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-log-collector refs/changes/31/27531/1 diff --git a/src/__main__.py b/src/__main__.py index 69e12b2..0a79d4a 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -51,7 +51,7 @@ SSH_SERVER_ALIVE_INTERVAL = 600 MAX_WARN_HOSTS_COUNT = 10 -#{Logging system +# {Logging system STREAM_LOG_FORMAT = '%(levelname)s: %(message)s' FILE_LOG_FORMAT = ( '%(asctime)s::' @@ -75,7 +75,7 @@ def filter(self, entry): return entry.levelno < logging.ERROR -#} +# } # Default DB connection params @@ -348,7 +348,7 @@ cp = ConfigParser.ConfigParser() cp.read(configs) - #backward compatibility with existing setup + # backward compatibility with existing setup if cp.has_option('LogCollector', 'rhevm'): if not cp.has_option('LogCollector', 'engine'): cp.set( @@ -395,7 +395,7 @@ # This doesn't ask for CTRL+C to abort because KeyboardInterrupts don't # seem to behave the same way every time. Take a look at the link: # "http://stackoverflow.com/questions/4606942/\ - #why-cant-i-handle-a-keyboardinterrupt-in-python" + # why-cant-i-handle-a-keyboardinterrupt-in-python" def _prompt(self, prompt_function, key, msg=None): value = get_from_prompt( msg="Please provide the %s (CTRL+D to skip): " % msg, @@ -435,12 +435,12 @@ def __log_to_stream(self, level): fmt = logging.Formatter(STREAM_LOG_FORMAT) - #Errors should always be there, on stderr + # Errors should always be there, on stderr h_err = logging.StreamHandler(sys.stderr) h_err.setLevel(logging.ERROR) h_err.setFormatter(fmt) logging.root.addHandler(h_err) - #Other logs should go to stdout + # Other logs should go to stdout sh = logging.StreamHandler(sys.stdout) sh.setLevel(level) sh.setFormatter(fmt) @@ -1090,7 +1090,7 @@ self.conf['host_pattern'] = host_patterns self.conf['hosts'] = self._get_hypervisors_from_api() - #Filter all host specified with -H + # Filter all host specified with -H host_filtered = set() if host_others: host_filtered = set([ @@ -1099,7 +1099,7 @@ ]) not_found = host_others - set(host[2] for host in host_filtered) if not_found != set(): - #try to resolve to ip specified hosts + # try to resolve to ip specified hosts for fqdn in set(not_found): try: ipaddr = socket.gethostbyname(fqdn) @@ -1115,7 +1115,7 @@ ) ) if not_found != set(): - #try to resolve to ip known hypervisors + # try to resolve to ip known hypervisors for (dc, cl, h) in self.conf['hosts']: try: ipaddr = socket.gethostbyname(h) @@ -1147,7 +1147,7 @@ if host_patterns or host_others: self.conf['hosts'] &= host_filtered - #Intersect with hosts belonging to the data centers specified with -d + # Intersect with hosts belonging to the data centers specified with -d if datacenter_patterns: datacenter_filtered = set() for pattern in datacenter_patterns: @@ -1156,9 +1156,9 @@ ) self.conf['hosts'] &= datacenter_filtered - #Intersect with hosts belonging to the clusters specified with -c + # Intersect with hosts belonging to the clusters specified with -c if cluster_patterns: - #remove all hosts that don't match the patterns + # remove all hosts that don't match the patterns cluster_filtered = set() for pattern in cluster_patterns: cluster_filtered |= self._filter_hosts('cluster', pattern) @@ -1666,7 +1666,7 @@ logging.debug("Configuration:") try: logging.debug("command: %s" % conf.command) - #multilog(logging.debug, pprint.pformat(conf)) + # multilog(logging.debug, pprint.pformat(conf)) except: pass multilog(logging.debug, traceback.format_exc()) diff --git a/src/sos/plugins/engine.py b/src/sos/plugins/engine.py index f56c4f3..9e00595 100644 --- a/src/sos/plugins/engine.py +++ b/src/sos/plugins/engine.py @@ -132,7 +132,7 @@ if self.getOption('sensitive_keys'): sensitive_keys = self.getOption('sensitive_keys') if self.getOption('sensitive_keys') is True: - #Handle --alloptions case which set this to True. + # Handle --alloptions case which set this to True. sensitive_keys = self.DEFAULT_SENSITIVE_KEYS key_list = [x for x in sensitive_keys.split(':') if x] for filename in self.copiedFiles: diff --git a/src/sos/plugins/ovirt_engine_dwh.py b/src/sos/plugins/ovirt_engine_dwh.py index d6a3162..f92fb89 100644 --- a/src/sos/plugins/ovirt_engine_dwh.py +++ b/src/sos/plugins/ovirt_engine_dwh.py @@ -1,18 +1,18 @@ -## Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola <sbona...@redhat.com> +# Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola <sbona...@redhat.com> -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """oVirt Engine DWH related information""" @@ -61,7 +61,7 @@ if self.getOption('sensitive_keys'): sensitive_keys = self.getOption('sensitive_keys') if self.getOption('sensitive_keys') is True: - #Handle --alloptions case which set this to True. + # Handle --alloptions case which set this to True. sensitive_keys = self.DEFAULT_SENSITIVE_KEYS key_list = [x for x in sensitive_keys.split(':') if x] for filename in self.copiedFiles: diff --git a/src/sos/plugins/ovirt_engine_reports.py b/src/sos/plugins/ovirt_engine_reports.py index 4296afb..adfe280 100644 --- a/src/sos/plugins/ovirt_engine_reports.py +++ b/src/sos/plugins/ovirt_engine_reports.py @@ -1,18 +1,18 @@ -## Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola <sbona...@redhat.com> +# Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola <sbona...@redhat.com> -### This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. """oVirt Engine Reports related information""" -- To view, visit http://gerrit.ovirt.org/27531 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e1b39482b6c94150a69bada02cd80d95505a3ae Gerrit-PatchSet: 1 Gerrit-Project: ovirt-log-collector Gerrit-Branch: ovirt-log-collector-3.4 Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches