From 3c0490b12a017954a8b63ab1b69700537fb21128 Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Mon, 12 Aug 2013 10:33:40 +1000 Subject: [PATCH] Fix pep8/flakes results --- turbo_hipster/lib/utils.py | 4 ++-- .../task_plugins/gate_real_db_upgrade/handle_results.py | 5 +++-- turbo_hipster/task_plugins/gate_real_db_upgrade/task.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/turbo_hipster/lib/utils.py b/turbo_hipster/lib/utils.py index a693ff7..9d3ecff 100644 --- a/turbo_hipster/lib/utils.py +++ b/turbo_hipster/lib/utils.py @@ -139,6 +139,7 @@ def execute_to_log(cmd, logfile, timeout=-1, def process(fd): """ Write the fd to log """ + global last_heartbeat descriptors[fd]['lines'] += os.read(fd, 1024 * 1024) # Avoid partial lines by only processing input with breaks if descriptors[fd]['lines'].find('\n') != -1: @@ -177,8 +178,7 @@ def push_file(job_name, file_path, publish_config): """ Push a log file to a server. Returns the public URL """ method = publish_config['type'] + '_push_file' if method in locals(): - return locals(method)(job_name, dataset['log_file_path'], - publish_config) + return locals(method)(job_name, file_path, publish_config) def swift_push_file(job_name, file_path, swift_config): diff --git a/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py b/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py index 3bac8c6..6cf332e 100644 --- a/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py +++ b/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py @@ -46,10 +46,11 @@ def generate_push_results(datasets): publish_config)) datasets[i]['files'] = files - index_file = make_index_file(datasets) + #index_file = make_index_file(datasets) #index_file_url = push_file(index_file) return files[0] + def check_log_for_errors(logfile): - return True \ No newline at end of file + return True diff --git a/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py b/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py index be6a3c2..9de945e 100644 --- a/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py +++ b/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py @@ -153,7 +153,7 @@ class Runner(threading.Thread): result = \ handle_results.check_log_for_errors(dataset['log_file_path']) if not result: - failed = true + failed = True break if failed: @@ -282,7 +282,7 @@ class Runner(threading.Thread): def _send_work_data(self): """ Send the WORK DATA in json format for job """ - self.log.debug("Send the work data response: %s" % + self.log.debug("Send the work data response: %s" % json.dumps(self._get_work_data())) self.job.sendWorkData(json.dumps(self._get_work_data()))