Refactor - fix flake8 warnings
This commit is contained in:
parent
6fe0c53f23
commit
d67d6df7a9
21
setup.py
21
setup.py
@ -4,20 +4,17 @@ from setuptools import setup
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
rqfiles = [('/usr/share/timmy/' + root, [os.path.join(root, f) for f in files])
|
rqfiles = [('/usr/share/timmy/' + 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']))
|
rqfiles.append(('/usr/share/timmy/configs', ['config.yaml']))
|
||||||
|
|
||||||
setup(name='timmy',
|
setup(name='timmy',
|
||||||
version='0.1',
|
version='0.1',
|
||||||
author = "Aleksandr Dobdin",
|
author="Aleksandr Dobdin",
|
||||||
author_email = 'dobdin@gmail.com',
|
author_email='dobdin@gmail.com',
|
||||||
license = 'Apache2',
|
license='Apache2',
|
||||||
url = 'https://github.com/adobdin/timmy',
|
url='https://github.com/adobdin/timmy',
|
||||||
long_description=open('README.md').read(),
|
long_description=open('README.md').read(),
|
||||||
packages = ["timmy"],
|
packages=["timmy"],
|
||||||
data_files = rqfiles,
|
data_files=rqfiles,
|
||||||
include_package_data = True,
|
include_package_data=True,
|
||||||
entry_points = {
|
entry_points={'console_scripts': ['timmy=timmy.cli:main']})
|
||||||
'console_scripts': ['timmy = timmy.cli:main']
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
@ -478,14 +478,14 @@ class Nodes(object):
|
|||||||
def exec_filter(self, node):
|
def exec_filter(self, node):
|
||||||
f = self.conf.soft_filter
|
f = self.conf.soft_filter
|
||||||
if f:
|
if f:
|
||||||
result = (((not f.status) or (node.status in f.status))
|
result = (((not f.status) or (node.status in f.status)) and
|
||||||
and ((not f.roles) or (node.role in f.roles))
|
((not f.roles) or (node.role in f.roles)) and
|
||||||
and ((not f.node_ids) or (node.node_id in f.node_ids)))
|
((not f.node_ids) or (node.node_id in f.node_ids)))
|
||||||
else:
|
else:
|
||||||
result = True
|
result = True
|
||||||
return result and (((self.cluster and node.cluster != 0
|
return result and (((self.cluster and node.cluster != 0 and
|
||||||
and str(self.cluster) == str(node.cluster))
|
str(self.cluster) == str(node.cluster)) or not
|
||||||
or not self.cluster) and node.online)
|
self.cluster) and node.online)
|
||||||
|
|
||||||
def launch_ssh(self, odir='info', timeout=15, fake=False):
|
def launch_ssh(self, odir='info', timeout=15, fake=False):
|
||||||
lock = flock.FLock('/tmp/timmy-cmds.lock')
|
lock = flock.FLock('/tmp/timmy-cmds.lock')
|
||||||
@ -495,8 +495,8 @@ class Nodes(object):
|
|||||||
try:
|
try:
|
||||||
label = ckey
|
label = ckey
|
||||||
run_items = []
|
run_items = []
|
||||||
for node in [n for n in self.nodes.values() if self.exec_filter(n)]:
|
for n in [n for n in self.nodes.values() if self.exec_filter(n)]:
|
||||||
run_items.append(tools.RunItem(target=node.exec_cmd,
|
run_items.append(tools.RunItem(target=n.exec_cmd,
|
||||||
args={'label': label,
|
args={'label': label,
|
||||||
'odir': odir,
|
'odir': odir,
|
||||||
'fake': fake}))
|
'fake': fake}))
|
||||||
@ -616,8 +616,8 @@ class Nodes(object):
|
|||||||
try:
|
try:
|
||||||
label = fkey
|
label = fkey
|
||||||
run_items = []
|
run_items = []
|
||||||
for node in [n for n in self.nodes.values() if self.exec_filter(n)]:
|
for n in [n for n in self.nodes.values() if self.exec_filter(n)]:
|
||||||
run_items.append(tools.RunItem(target=node.get_files,
|
run_items.append(tools.RunItem(target=n.get_files,
|
||||||
args={'label': label,
|
args={'label': label,
|
||||||
'odir': odir}))
|
'odir': odir}))
|
||||||
tools.run_batch(run_items, 10)
|
tools.run_batch(run_items, 10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user