fix: flake8 warns, setup.py

This commit is contained in:
adobdin 2016-05-12 10:38:52 +00:00
parent cfe63a5e83
commit 2e4d02fec3
3 changed files with 6 additions and 5 deletions

View File

@ -3,9 +3,10 @@
from setuptools import setup from setuptools import setup
import os 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')] 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', setup(name='timmy',
version='1.0', version='1.0',

View File

@ -124,7 +124,7 @@ def main(argv=None):
main_arc, main_arc,
60) 60)
if args.only_logs or args.getlogs: 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) lock = flock.FLock(lf)
if lock.lock(): if lock.lock():
size = nm.calculate_log_size(args.maxthreads) size = nm.calculate_log_size(args.maxthreads)

View File

@ -623,8 +623,8 @@ class NodeManager(object):
txtfl.append(logslistfile) txtfl.append(logslistfile)
try: try:
with open(logslistfile, 'w') as llf: with open(logslistfile, 'w') as llf:
for filename in node.logs_dict(): for fn in node.logs_dict():
llf.write(filename.lstrip(os.path.abspath(os.sep))+"\0") llf.write(fn.lstrip(os.path.abspath(os.sep))+"\0")
except: except:
logging.error("create_archive_logs: Can't write to file %s" % logging.error("create_archive_logs: Can't write to file %s" %
logslistfile) logslistfile)