Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/files/log/import.py

Issue 29338680: Issue 3825 - Replace Logstash setup with Fluentd (Closed)
Patch Set: Created March 18, 2016, 6:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | modules/adblockplus/manifests/log.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/files/log/import.py
diff --git a/modules/adblockplus/files/log/import.py b/modules/adblockplus/files/log/import.py
deleted file mode 100644
index fc55fa4bfe2bf3c977152bb65d738729e4c41f54..0000000000000000000000000000000000000000
--- a/modules/adblockplus/files/log/import.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*- ------------------------------------------------
-# vi:set fenc=utf-8 ft=python ts=8 et sw=4 sts=4:
-
-__doc__ = """ Redirect STDIN into an ABP log channel.
-
-"""
-import argparse
-import fcntl
-import os
-import shutil
-import sys
-
-try:
- parser = argparse.ArgumentParser(allow_abbrev=False, description=__doc__)
-except TypeError:
- parser = argparse.ArgumentParser(description=__doc__)
-
-parser.add_argument(
- 'name',
- help='The base name of the logfile to import',
- metavar='LOG',
- type=str,
-)
-
-parser.add_argument(
- '-s', '--source',
- help='The name (recommended) or IP of the source host',
- metavar='HOSTNAME',
- type=str,
-)
-
-parser.add_argument(
- '-t', '--target',
- help='The location of the upload/import directory',
- metavar='DIRECTORY',
- type=str,
-)
-
-arguments = parser.parse_args()
-destination = os.path.join(arguments.target, arguments.source, arguments.name)
-output = open(destination, 'a')
-fcntl.flock(output, fcntl.F_WRLCK | fcntl.F_EXLCK)
-
-try:
- shutil.copyfileobj(sys.stdin, output)
-finally:
- fcntl.flock(output, fcntl.F_UNLCK)
-
-output.close()
« no previous file with comments | « no previous file | modules/adblockplus/manifests/log.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld