From 2e4d02fec3a2f18bb907d5755f07613faa5da9c4 Mon Sep 17 00:00:00 2001 From: adobdin Date: Thu, 12 May 2016 10:38:52 +0000 Subject: [PATCH] fix: flake8 warns, setup.py --- setup.py | 5 +++-- timmy/cli.py | 2 +- timmy/nodes.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 8b3c9e3..a7f41d6 100644 --- a/setup.py +++ b/setup.py @@ -3,9 +3,10 @@ from setuptools import setup import os -rqfiles = [('/usr/share/timmy/' + root, [os.path.join(root, f) for f in files]) +dtm = os.path.join(os.path.abspath(os.sep), 'usr', 'share', 'timmy') +rqfiles = [(os.path.join(dtm, root), [os.path.join(root, f) for f in files]) for root, dirs, files in os.walk('rq')] -rqfiles.append(('/usr/share/timmy/configs', ['config.yaml', 'rq.yaml'])) +rqfiles.append((os.path.join(dtm, 'configs'), ['config.yaml', 'rq.yaml'])) setup(name='timmy', version='1.0', diff --git a/timmy/cli.py b/timmy/cli.py index 3f3acf4..317d5d9 100755 --- a/timmy/cli.py +++ b/timmy/cli.py @@ -124,7 +124,7 @@ def main(argv=None): main_arc, 60) if args.only_logs or args.getlogs: - lf = os.path.join(gettempdir(),'timmy-logs.lock') + lf = os.path.join(gettempdir(), 'timmy-logs.lock') lock = flock.FLock(lf) if lock.lock(): size = nm.calculate_log_size(args.maxthreads) diff --git a/timmy/nodes.py b/timmy/nodes.py index e1ccdb6..179ceaa 100644 --- a/timmy/nodes.py +++ b/timmy/nodes.py @@ -623,8 +623,8 @@ class NodeManager(object): txtfl.append(logslistfile) try: with open(logslistfile, 'w') as llf: - for filename in node.logs_dict(): - llf.write(filename.lstrip(os.path.abspath(os.sep))+"\0") + for fn in node.logs_dict(): + llf.write(fn.lstrip(os.path.abspath(os.sep))+"\0") except: logging.error("create_archive_logs: Can't write to file %s" % logslistfile)