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 - BUGFIXES
- Fix missing exit code - Remove multiprocessing due to bad implementation and resulting performance issues
- Fix small role issues

View File

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

View File

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

View File

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