Skip to content

Commit

Permalink
Merge pull request #446 from HubSpot/logfetch_fixes
Browse files Browse the repository at this point in the history
logfetch fixes
  • Loading branch information
ssalinas committed Feb 17, 2015
2 parents 660b63a + e956b59 commit 8a5ce4f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions scripts/logfetch/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import ConfigParser
import sys
import os
import pkg_resources
from termcolor import colored
from fake_section_head import FakeSectionHead
from live_logs import download_live_logs
Expand All @@ -10,6 +11,7 @@
from grep import grep_files
from cat import cat_files

VERSION = pkg_resources.require("singularity-logfetch")[0].version
CONF_READ_ERR_FORMAT = 'Could not load config from {0} due to {1}'
DEFAULT_CONF_DIR = os.path.expanduser('~/.logfetch')
DEFAULT_CONF_FILE = 'default'
Expand Down Expand Up @@ -55,7 +57,7 @@ def check_dest(args):
os.makedirs(args.dest)

def fetch():
conf_parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, add_help=False)
conf_parser = argparse.ArgumentParser(version=VERSION, description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, add_help=False)
conf_parser.add_argument("-f", "--conf-folder", dest='conf_folder', help="specify a folder for config files to live")
conf_parser.add_argument("-c", "--conf-file", dest='conf_file', help="Specify config file within the conf folder", metavar="FILE")
args, remaining_argv = conf_parser.parse_known_args()
Expand Down Expand Up @@ -106,7 +108,7 @@ def fetch():
fetch_logs(args)

def cat():
conf_parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, add_help=False)
conf_parser = argparse.ArgumentParser(version=VERSION, description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, add_help=False)
conf_parser.add_argument("-f", "--conf-folder", dest="conf_folder", help="specify a folder for config files to live")
conf_parser.add_argument("-c", "--conf-file", dest="conf_file", help="Specify config file within the conf folder", metavar="FILE")
args, remaining_argv = conf_parser.parse_known_args()
Expand Down Expand Up @@ -156,7 +158,7 @@ def cat():
cat_logs(args)

def tail():
conf_parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, add_help=False)
conf_parser = argparse.ArgumentParser(version=VERSION, description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter, add_help=False)
conf_parser.add_argument("-f", "--conf-folder", dest="conf_folder", help="specify a folder for config files to live")
conf_parser.add_argument("-c", "--conf-file", dest="conf_file", help="Specify config file within the conf folder", metavar="FILE")
args, remaining_argv = conf_parser.parse_known_args()
Expand All @@ -182,7 +184,7 @@ def tail():
parser.add_argument("-u", "--singularity-uri-base", dest="singularity_uri_base", help="The base for singularity (eg. http://localhost:8080/singularity/v1)")
parser.add_argument("-g", "--grep", dest="grep", help="String to grep for")
parser.add_argument("-l", "--logfile", dest="logfile", help="Logfile path/name to tail (ie 'logs/access.log')")
parser.add_argument("-v", "--verbose", dest="verbose", help="more verbose output", action='store_true')
parser.add_argument("-V", "--verbose", dest="verbose", help="more verbose output", action='store_true')

args = parser.parse_args(remaining_argv)

Expand Down
2 changes: 1 addition & 1 deletion scripts/logfetch/tail.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def start_tail(args):
if not t.isAlive:
break
except KeyboardInterrupt:
sys.stderr.write(colored('Stopping tail', 'magenta'))
sys.stderr.write(colored('Stopping tail', 'magenta') + '\n')
sys.exit(0)

class LogStreamer(threading.Thread):
Expand Down
2 changes: 1 addition & 1 deletion scripts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='singularity-logfetch',
version='0.0.9',
version='0.10.0',
description='Singularity log fetching and searching',
author="HubSpot",
author_email='singularity-users@googlegroups.com',
Expand Down

0 comments on commit 8a5ce4f

Please # to comment.