prepare bugfix release

This commit is contained in:
Robert Kaussow 2019-04-16 09:58:57 +02:00
parent ef05c82f50
commit d6b954c77c
4 changed files with 6 additions and 14 deletions

View File

@ -1,3 +1,2 @@
- BUGFIXES
- Fix missing exit code
- Fix small role issues
- Remove multiprocessing due to bad implementation and resulting performance issues

View File

@ -2,7 +2,7 @@
__author__ = "Robert Kaussow"
__project__ = "ansible-later"
__version__ = "0.2.2"
__version__ = "0.2.3"
__license__ = "MIT"
__maintainer__ = "Robert Kaussow"
__email__ = "mail@geeklabor.de"

View File

@ -2,7 +2,6 @@
"""Main program."""
import argparse
import multiprocessing
from ansiblelater import LOG
from ansiblelater import __version__
@ -38,9 +37,7 @@ def main():
files = config["rules"]["files"]
standards = base.get_standards(config["rules"]["standards"])
workers = max(multiprocessing.cpu_count() - 2, 2)
p = multiprocessing.Pool(workers)
errors = []
errors = 0
for filename in files:
lines = None
candidate = candidates.classify(filename, settings, standards)
@ -55,14 +52,11 @@ def main():
LOG.info("Reviewing %s lines %s" % (candidate, lines))
else:
LOG.info("Reviewing all of %s" % candidate)
errors = errors + p.map(candidate.review, [(settings, lines)])
errors = errors + candidate.review(settings, lines)
else:
LOG.info("Couldn't classify file %s" % filename)
p.close()
p.join()
return 0 if sum(errors) == 0 else 1
return errors
if __name__ == "__main__":

View File

@ -102,8 +102,7 @@ class Candidate(object):
return target_standards
def review(self, args):
(settings, lines) = args
def review(self, settings, lines=0):
errors = 0
for standard in self.standards: