From e567722c4ea125f4607093112396e16ae6c6dd42 Mon Sep 17 00:00:00 2001 From: John Dickinson Date: Mon, 22 Sep 2014 09:46:34 -0700 Subject: [PATCH] updated hacking rules 1) Added comment for H231, which we were already enforcing. H231 is for Python 3.x compatible except statements. 2) Added check for H201, which we were enforcing in reviews but waiting on hacking checks to be updated. H201 is for bare except statements, and the update in upstream hacking is to support the " # noqa" flag on it. The H201 check catches some existing bare excepts that are fixed. Change-Id: I68638aa9ea925ef62f9035a426548c2c804911a8 --- .../middleware/x_profile/html_viewer.py | 96 +++++++++---------- swift/common/middleware/xprofile.py | 19 ++-- swift/container/reconciler.py | 2 +- test/unit/cli/test_recon.py | 2 +- tox.ini | 5 +- 5 files changed, 60 insertions(+), 64 deletions(-) diff --git a/swift/common/middleware/x_profile/html_viewer.py b/swift/common/middleware/x_profile/html_viewer.py index 416ba01165..91ad8f66a2 100644 --- a/swift/common/middleware/x_profile/html_viewer.py +++ b/swift/common/middleware/x_profile/html_viewer.py @@ -313,55 +313,55 @@ class HTMLViewer(object): return empty_description, headers try: stats = Stats2(*log_files) - if not fulldirs: - stats.strip_dirs() - stats.sort_stats(sort) - nfl_filter_esc =\ - nfl_filter.replace('(', '\(').replace(')', '\)') - amount = [nfl_filter_esc, limit] if nfl_filter_esc else [limit] - profile_html = self.generate_stats_html(stats, self.app_path, - profile_id, *amount) - description = "Profiling information is generated by using\ - '%s' profiler." % self.profile_module - sort_repl = '' % (p, p) - for p in self.profile_log.get_all_pids()]) - profile_element = string.Template(profile_tmpl).substitute( - {'profile_list': plist}) - profile_repl = '' % (p, p) + for p in self.profile_log.get_all_pids()]) + profile_element = string.Template(profile_tmpl).substitute( + {'profile_list': plist}) + profile_repl = '