From 1231da46bfd70e40ceaf65447f7e123bfe122d7d Mon Sep 17 00:00:00 2001 From: Puneeth Chaganti Date: Wed, 12 Jun 2019 10:40:05 +0530 Subject: [PATCH] log2zulip: Remove unnecessary loop and fix incorrect variable name. --- zulip/integrations/log2zulip/log2zulip | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zulip/integrations/log2zulip/log2zulip b/zulip/integrations/log2zulip/log2zulip index abdacfd..427f595 100755 --- a/zulip/integrations/log2zulip/log2zulip +++ b/zulip/integrations/log2zulip/log2zulip @@ -66,8 +66,7 @@ def process_lines(raw_lines, file_name): def process_logs(): # type: () -> None - for filename in log_files: - data_file_path = os.path.join(temp_dir, "log2zulip.state") + data_file_path = os.path.join(temp_dir, "log2zulip.state") mkdir_p(os.path.dirname(data_file_path)) if not os.path.exists(data_file_path): open(data_file_path, "w").write("{}") @@ -91,7 +90,7 @@ def process_logs(): output = subprocess.check_output(["tail", "-n+%s" % (file_data["last"],), log_file]) new_lines = output.decode('utf-8', errors='replace').split('\n')[:-1] if len(new_lines) > 0: - process_lines(new_lines, filename) + process_lines(new_lines, log_file) file_data["last"] += len(new_lines) new_data[log_file] = file_data open(data_file_path, "w").write(json.dumps(new_data))